111 #ifndef PY_SSIZE_T_CLEAN
112 #define PY_SSIZE_T_CLEAN
116 #error Python headers needed to compile C extensions, please install development version of Python.
117 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
118 #error Cython requires Python 2.6+ or Python 3.3+.
120 #define CYTHON_ABI "0_29_36"
121 #define CYTHON_HEX_VERSION 0x001D24F0
122 #define CYTHON_FUTURE_DIVISION 1
125 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
127 #if !defined(WIN32) && !defined(MS_WINDOWS)
139 #define DL_IMPORT(t) t
142 #define DL_EXPORT(t) t
144 #define __PYX_COMMA ,
145 #ifndef HAVE_LONG_LONG
146 #if PY_VERSION_HEX >= 0x02070000
147 #define HAVE_LONG_LONG
151 #define PY_LONG_LONG LONG_LONG
154 #define Py_HUGE_VAL HUGE_VAL
157 #define CYTHON_COMPILING_IN_PYPY 1
158 #define CYTHON_COMPILING_IN_PYSTON 0
159 #define CYTHON_COMPILING_IN_CPYTHON 0
160 #define CYTHON_COMPILING_IN_NOGIL 0
161 #undef CYTHON_USE_TYPE_SLOTS
162 #define CYTHON_USE_TYPE_SLOTS 0
163 #undef CYTHON_USE_PYTYPE_LOOKUP
164 #define CYTHON_USE_PYTYPE_LOOKUP 0
165 #if PY_VERSION_HEX < 0x03050000
166 #undef CYTHON_USE_ASYNC_SLOTS
167 #define CYTHON_USE_ASYNC_SLOTS 0
168 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
169 #define CYTHON_USE_ASYNC_SLOTS 1
171 #undef CYTHON_USE_PYLIST_INTERNALS
172 #define CYTHON_USE_PYLIST_INTERNALS 0
173 #undef CYTHON_USE_UNICODE_INTERNALS
174 #define CYTHON_USE_UNICODE_INTERNALS 0
175 #undef CYTHON_USE_UNICODE_WRITER
176 #define CYTHON_USE_UNICODE_WRITER 0
177 #undef CYTHON_USE_PYLONG_INTERNALS
178 #define CYTHON_USE_PYLONG_INTERNALS 0
179 #undef CYTHON_AVOID_BORROWED_REFS
180 #define CYTHON_AVOID_BORROWED_REFS 1
181 #undef CYTHON_ASSUME_SAFE_MACROS
182 #define CYTHON_ASSUME_SAFE_MACROS 0
183 #undef CYTHON_UNPACK_METHODS
184 #define CYTHON_UNPACK_METHODS 0
185 #undef CYTHON_FAST_THREAD_STATE
186 #define CYTHON_FAST_THREAD_STATE 0
187 #undef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL 0
189 #if PY_VERSION_HEX < 0x03090000
190 #undef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
192 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
193 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
195 #undef CYTHON_USE_TP_FINALIZE
196 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
197 #undef CYTHON_USE_DICT_VERSIONS
198 #define CYTHON_USE_DICT_VERSIONS 0
199 #undef CYTHON_USE_EXC_INFO_STACK
200 #define CYTHON_USE_EXC_INFO_STACK 0
201 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
202 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
204 #elif defined(PYSTON_VERSION)
205 #define CYTHON_COMPILING_IN_PYPY 0
206 #define CYTHON_COMPILING_IN_PYSTON 1
207 #define CYTHON_COMPILING_IN_CPYTHON 0
208 #define CYTHON_COMPILING_IN_NOGIL 0
209 #ifndef CYTHON_USE_TYPE_SLOTS
210 #define CYTHON_USE_TYPE_SLOTS 1
212 #undef CYTHON_USE_PYTYPE_LOOKUP
213 #define CYTHON_USE_PYTYPE_LOOKUP 0
214 #undef CYTHON_USE_ASYNC_SLOTS
215 #define CYTHON_USE_ASYNC_SLOTS 0
216 #undef CYTHON_USE_PYLIST_INTERNALS
217 #define CYTHON_USE_PYLIST_INTERNALS 0
218 #ifndef CYTHON_USE_UNICODE_INTERNALS
219 #define CYTHON_USE_UNICODE_INTERNALS 1
221 #undef CYTHON_USE_UNICODE_WRITER
222 #define CYTHON_USE_UNICODE_WRITER 0
223 #undef CYTHON_USE_PYLONG_INTERNALS
224 #define CYTHON_USE_PYLONG_INTERNALS 0
225 #ifndef CYTHON_AVOID_BORROWED_REFS
226 #define CYTHON_AVOID_BORROWED_REFS 0
228 #ifndef CYTHON_ASSUME_SAFE_MACROS
229 #define CYTHON_ASSUME_SAFE_MACROS 1
231 #ifndef CYTHON_UNPACK_METHODS
232 #define CYTHON_UNPACK_METHODS 1
234 #undef CYTHON_FAST_THREAD_STATE
235 #define CYTHON_FAST_THREAD_STATE 0
236 #undef CYTHON_FAST_PYCALL
237 #define CYTHON_FAST_PYCALL 0
238 #undef CYTHON_PEP489_MULTI_PHASE_INIT
239 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
240 #undef CYTHON_USE_TP_FINALIZE
241 #define CYTHON_USE_TP_FINALIZE 0
242 #undef CYTHON_USE_DICT_VERSIONS
243 #define CYTHON_USE_DICT_VERSIONS 0
244 #undef CYTHON_USE_EXC_INFO_STACK
245 #define CYTHON_USE_EXC_INFO_STACK 0
246 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
247 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
249 #elif defined(PY_NOGIL)
250 #define CYTHON_COMPILING_IN_PYPY 0
251 #define CYTHON_COMPILING_IN_PYSTON 0
252 #define CYTHON_COMPILING_IN_CPYTHON 0
253 #define CYTHON_COMPILING_IN_NOGIL 1
254 #ifndef CYTHON_USE_TYPE_SLOTS
255 #define CYTHON_USE_TYPE_SLOTS 1
257 #undef CYTHON_USE_PYTYPE_LOOKUP
258 #define CYTHON_USE_PYTYPE_LOOKUP 0
259 #ifndef CYTHON_USE_ASYNC_SLOTS
260 #define CYTHON_USE_ASYNC_SLOTS 1
262 #undef CYTHON_USE_PYLIST_INTERNALS
263 #define CYTHON_USE_PYLIST_INTERNALS 0
264 #ifndef CYTHON_USE_UNICODE_INTERNALS
265 #define CYTHON_USE_UNICODE_INTERNALS 1
267 #undef CYTHON_USE_UNICODE_WRITER
268 #define CYTHON_USE_UNICODE_WRITER 0
269 #undef CYTHON_USE_PYLONG_INTERNALS
270 #define CYTHON_USE_PYLONG_INTERNALS 0
271 #ifndef CYTHON_AVOID_BORROWED_REFS
272 #define CYTHON_AVOID_BORROWED_REFS 0
274 #ifndef CYTHON_ASSUME_SAFE_MACROS
275 #define CYTHON_ASSUME_SAFE_MACROS 1
277 #ifndef CYTHON_UNPACK_METHODS
278 #define CYTHON_UNPACK_METHODS 1
280 #undef CYTHON_FAST_THREAD_STATE
281 #define CYTHON_FAST_THREAD_STATE 0
282 #undef CYTHON_FAST_PYCALL
283 #define CYTHON_FAST_PYCALL 0
284 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
285 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
287 #ifndef CYTHON_USE_TP_FINALIZE
288 #define CYTHON_USE_TP_FINALIZE 1
290 #undef CYTHON_USE_DICT_VERSIONS
291 #define CYTHON_USE_DICT_VERSIONS 0
292 #undef CYTHON_USE_EXC_INFO_STACK
293 #define CYTHON_USE_EXC_INFO_STACK 0
295 #define CYTHON_COMPILING_IN_PYPY 0
296 #define CYTHON_COMPILING_IN_PYSTON 0
297 #define CYTHON_COMPILING_IN_CPYTHON 1
298 #define CYTHON_COMPILING_IN_NOGIL 0
299 #ifndef CYTHON_USE_TYPE_SLOTS
300 #define CYTHON_USE_TYPE_SLOTS 1
302 #if PY_VERSION_HEX < 0x02070000
303 #undef CYTHON_USE_PYTYPE_LOOKUP
304 #define CYTHON_USE_PYTYPE_LOOKUP 0
305 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
306 #define CYTHON_USE_PYTYPE_LOOKUP 1
308 #if PY_MAJOR_VERSION < 3
309 #undef CYTHON_USE_ASYNC_SLOTS
310 #define CYTHON_USE_ASYNC_SLOTS 0
311 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
312 #define CYTHON_USE_ASYNC_SLOTS 1
314 #if PY_VERSION_HEX < 0x02070000
315 #undef CYTHON_USE_PYLONG_INTERNALS
316 #define CYTHON_USE_PYLONG_INTERNALS 0
317 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
318 #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
320 #ifndef CYTHON_USE_PYLIST_INTERNALS
321 #define CYTHON_USE_PYLIST_INTERNALS 1
323 #ifndef CYTHON_USE_UNICODE_INTERNALS
324 #define CYTHON_USE_UNICODE_INTERNALS 1
326 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
327 #undef CYTHON_USE_UNICODE_WRITER
328 #define CYTHON_USE_UNICODE_WRITER 0
329 #elif !defined(CYTHON_USE_UNICODE_WRITER)
330 #define CYTHON_USE_UNICODE_WRITER 1
332 #ifndef CYTHON_AVOID_BORROWED_REFS
333 #define CYTHON_AVOID_BORROWED_REFS 0
335 #ifndef CYTHON_ASSUME_SAFE_MACROS
336 #define CYTHON_ASSUME_SAFE_MACROS 1
338 #ifndef CYTHON_UNPACK_METHODS
339 #define CYTHON_UNPACK_METHODS 1
341 #if PY_VERSION_HEX >= 0x030B00A4
342 #undef CYTHON_FAST_THREAD_STATE
343 #define CYTHON_FAST_THREAD_STATE 0
344 #elif !defined(CYTHON_FAST_THREAD_STATE)
345 #define CYTHON_FAST_THREAD_STATE 1
347 #ifndef CYTHON_FAST_PYCALL
348 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
350 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
351 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
353 #ifndef CYTHON_USE_TP_FINALIZE
354 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
356 #ifndef CYTHON_USE_DICT_VERSIONS
357 #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
359 #if PY_VERSION_HEX >= 0x030B00A4
360 #undef CYTHON_USE_EXC_INFO_STACK
361 #define CYTHON_USE_EXC_INFO_STACK 0
362 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
363 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
365 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
366 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
369 #if !defined(CYTHON_FAST_PYCCALL)
370 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
372 #if CYTHON_USE_PYLONG_INTERNALS
373 #if PY_MAJOR_VERSION < 3
374 #include "longintrepr.h"
380 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
383 #ifndef __has_attribute
384 #define __has_attribute(x) 0
386 #ifndef __has_cpp_attribute
387 #define __has_cpp_attribute(x) 0
389 #ifndef CYTHON_RESTRICT
390 #if defined(__GNUC__)
391 #define CYTHON_RESTRICT __restrict__
392 #elif defined(_MSC_VER) && _MSC_VER >= 1400
393 #define CYTHON_RESTRICT __restrict
394 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
395 #define CYTHON_RESTRICT restrict
397 #define CYTHON_RESTRICT
400 #ifndef CYTHON_UNUSED
401 # if defined(__GNUC__)
402 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
403 # define CYTHON_UNUSED __attribute__ ((__unused__))
405 # define CYTHON_UNUSED
407 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
408 # define CYTHON_UNUSED __attribute__ ((__unused__))
410 # define CYTHON_UNUSED
413 #ifndef CYTHON_MAYBE_UNUSED_VAR
414 # if defined(__cplusplus)
415 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
417 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
420 #ifndef CYTHON_NCP_UNUSED
421 # if CYTHON_COMPILING_IN_CPYTHON
422 # define CYTHON_NCP_UNUSED
424 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
427 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
429 #ifndef _MSC_STDINT_H_
431 typedef unsigned char uint8_t;
432 typedef unsigned int uint32_t;
434 typedef unsigned __int8 uint8_t;
435 typedef unsigned __int32 uint32_t;
441 #ifndef CYTHON_FALLTHROUGH
442 #if defined(__cplusplus) && __cplusplus >= 201103L
443 #if __has_cpp_attribute(fallthrough)
444 #define CYTHON_FALLTHROUGH [[fallthrough]]
445 #elif __has_cpp_attribute(clang::fallthrough)
446 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
447 #elif __has_cpp_attribute(gnu::fallthrough)
448 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
451 #ifndef CYTHON_FALLTHROUGH
452 #if __has_attribute(fallthrough)
453 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
455 #define CYTHON_FALLTHROUGH
458 #if defined(__clang__ ) && defined(__apple_build_version__)
459 #if __apple_build_version__ < 7000000
460 #undef CYTHON_FALLTHROUGH
461 #define CYTHON_FALLTHROUGH
467 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
469 #ifndef CYTHON_INLINE
470 #if defined(__clang__)
471 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
473 #define CYTHON_INLINE inline
477 void __Pyx_call_destructor(T& x) {
481 class __Pyx_FakeReference {
483 __Pyx_FakeReference() : ptr(NULL) { }
484 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
485 T *operator->() {
return ptr; }
486 T *operator&() {
return ptr; }
487 operator T&() {
return *ptr; }
488 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
489 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
494 #define __PYX_BUILD_PY_SSIZE_T "n"
495 #define CYTHON_FORMAT_SSIZE_T "z"
496 #if PY_MAJOR_VERSION < 3
497 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
498 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
499 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
500 #define __Pyx_DefaultClassType PyClass_Type
502 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
503 #define __Pyx_DefaultClassType PyType_Type
504 #if PY_VERSION_HEX >= 0x030B00A1
505 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
506 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
507 PyObject *fv, PyObject *cell, PyObject* fn,
508 PyObject *name,
int fline, PyObject *lnos) {
509 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
510 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
511 const char *fn_cstr=NULL;
512 const char *name_cstr=NULL;
513 PyCodeObject* co=NULL;
514 PyObject *type, *value, *traceback;
515 PyErr_Fetch(&type, &value, &traceback);
516 if (!(kwds=PyDict_New()))
goto end;
517 if (!(argcount=PyLong_FromLong(a)))
goto end;
518 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
519 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
520 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
521 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
522 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
523 if (!(nlocals=PyLong_FromLong(l)))
goto end;
524 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
525 if (!(stacksize=PyLong_FromLong(s)))
goto end;
526 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
527 if (!(flags=PyLong_FromLong(f)))
goto end;
528 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
529 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
530 if (PyDict_SetItemString(kwds,
"co_consts", c) != 0)
goto end;
531 if (PyDict_SetItemString(kwds,
"co_names", n) != 0)
goto end;
532 if (PyDict_SetItemString(kwds,
"co_varnames", v) != 0)
goto end;
533 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
534 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
535 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
536 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
537 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
538 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
539 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
540 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
541 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
542 Py_XDECREF((PyObject*)co);
543 co = (PyCodeObject*)call_result;
547 Py_XDECREF((PyObject*)co);
552 Py_XDECREF(argcount);
553 Py_XDECREF(posonlyargcount);
554 Py_XDECREF(kwonlyargcount);
556 Py_XDECREF(stacksize);
558 Py_XDECREF(call_result);
561 PyErr_Restore(type, value, traceback);
566 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
567 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
569 #define __Pyx_DefaultClassType PyType_Type
571 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
572 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
574 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
576 #ifndef Py_TPFLAGS_CHECKTYPES
577 #define Py_TPFLAGS_CHECKTYPES 0
579 #ifndef Py_TPFLAGS_HAVE_INDEX
580 #define Py_TPFLAGS_HAVE_INDEX 0
582 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
583 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
585 #ifndef Py_TPFLAGS_HAVE_FINALIZE
586 #define Py_TPFLAGS_HAVE_FINALIZE 0
588 #ifndef METH_STACKLESS
589 #define METH_STACKLESS 0
591 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
592 #ifndef METH_FASTCALL
593 #define METH_FASTCALL 0x80
595 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
596 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
597 Py_ssize_t nargs, PyObject *kwnames);
599 #define __Pyx_PyCFunctionFast _PyCFunctionFast
600 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
602 #if CYTHON_FAST_PYCCALL
603 #define __Pyx_PyFastCFunction_Check(func)\
604 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
606 #define __Pyx_PyFastCFunction_Check(func) 0
608 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
609 #define PyObject_Malloc(s) PyMem_Malloc(s)
610 #define PyObject_Free(p) PyMem_Free(p)
611 #define PyObject_Realloc(p) PyMem_Realloc(p)
613 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
614 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
615 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
616 #define PyMem_RawFree(p) PyMem_Free(p)
618 #if CYTHON_COMPILING_IN_PYSTON
619 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
620 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
622 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
623 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
625 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
626 #define __Pyx_PyThreadState_Current PyThreadState_GET()
627 #elif PY_VERSION_HEX >= 0x03060000
628 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
629 #elif PY_VERSION_HEX >= 0x03000000
630 #define __Pyx_PyThreadState_Current PyThreadState_GET()
632 #define __Pyx_PyThreadState_Current _PyThreadState_Current
634 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
635 #include "pythread.h"
636 #define Py_tss_NEEDS_INIT 0
637 typedef int Py_tss_t;
638 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
639 *key = PyThread_create_key();
642 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
643 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
644 *key = Py_tss_NEEDS_INIT;
647 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
650 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
651 return *key != Py_tss_NEEDS_INIT;
653 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
654 PyThread_delete_key(*key);
655 *key = Py_tss_NEEDS_INIT;
657 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
658 return PyThread_set_key_value(*key, value);
660 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
661 return PyThread_get_key_value(*key);
664 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
665 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
667 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
669 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
670 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
671 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
673 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
674 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
676 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
677 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
679 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
681 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
682 #define CYTHON_PEP393_ENABLED 1
683 #if PY_VERSION_HEX >= 0x030C0000
684 #define __Pyx_PyUnicode_READY(op) (0)
686 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
687 0 : _PyUnicode_Ready((PyObject *)(op)))
689 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
690 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
691 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
692 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
693 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
694 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
695 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
696 #if PY_VERSION_HEX >= 0x030C0000
697 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
699 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
700 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
702 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
706 #define CYTHON_PEP393_ENABLED 0
707 #define PyUnicode_1BYTE_KIND 1
708 #define PyUnicode_2BYTE_KIND 2
709 #define PyUnicode_4BYTE_KIND 4
710 #define __Pyx_PyUnicode_READY(op) (0)
711 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
712 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
713 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
714 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
715 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
716 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
717 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
718 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
720 #if CYTHON_COMPILING_IN_PYPY
721 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
722 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
724 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
725 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
726 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
728 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
729 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
731 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
732 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
734 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
735 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
737 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
738 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
739 #if PY_MAJOR_VERSION >= 3
740 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
742 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
744 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
745 #define PyObject_ASCII(o) PyObject_Repr(o)
747 #if PY_MAJOR_VERSION >= 3
748 #define PyBaseString_Type PyUnicode_Type
749 #define PyStringObject PyUnicodeObject
750 #define PyString_Type PyUnicode_Type
751 #define PyString_Check PyUnicode_Check
752 #define PyString_CheckExact PyUnicode_CheckExact
753 #ifndef PyObject_Unicode
754 #define PyObject_Unicode PyObject_Str
757 #if PY_MAJOR_VERSION >= 3
758 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
759 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
761 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
762 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
764 #ifndef PySet_CheckExact
765 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
767 #if PY_VERSION_HEX >= 0x030900A4
768 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
769 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
771 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
772 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
774 #if CYTHON_ASSUME_SAFE_MACROS
775 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
777 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
779 #if PY_MAJOR_VERSION >= 3
780 #define PyIntObject PyLongObject
781 #define PyInt_Type PyLong_Type
782 #define PyInt_Check(op) PyLong_Check(op)
783 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
784 #define PyInt_FromString PyLong_FromString
785 #define PyInt_FromUnicode PyLong_FromUnicode
786 #define PyInt_FromLong PyLong_FromLong
787 #define PyInt_FromSize_t PyLong_FromSize_t
788 #define PyInt_FromSsize_t PyLong_FromSsize_t
789 #define PyInt_AsLong PyLong_AsLong
790 #define PyInt_AS_LONG PyLong_AS_LONG
791 #define PyInt_AsSsize_t PyLong_AsSsize_t
792 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
793 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
794 #define PyNumber_Int PyNumber_Long
796 #if PY_MAJOR_VERSION >= 3
797 #define PyBoolObject PyLongObject
799 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
800 #ifndef PyUnicode_InternFromString
801 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
804 #if PY_VERSION_HEX < 0x030200A4
805 typedef long Py_hash_t;
806 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
807 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
809 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
810 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
812 #if PY_MAJOR_VERSION >= 3
813 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
815 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
817 #if CYTHON_USE_ASYNC_SLOTS
818 #if PY_VERSION_HEX >= 0x030500B1
819 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
820 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
822 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
825 #define __Pyx_PyType_AsAsync(obj) NULL
827 #ifndef __Pyx_PyAsyncMethodsStruct
832 } __Pyx_PyAsyncMethodsStruct;
835 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
836 #if !defined(_USE_MATH_DEFINES)
837 #define _USE_MATH_DEFINES
842 #define __PYX_NAN() ((float) NAN)
844 static CYTHON_INLINE
float __PYX_NAN() {
846 memset(&value, 0xFF,
sizeof(value));
850 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
851 #define __Pyx_truncl trunc
853 #define __Pyx_truncl truncl
856 #define __PYX_MARK_ERR_POS(f_index, lineno) \
857 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
858 #define __PYX_ERR(f_index, lineno, Ln_error) \
859 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
861 #ifndef __PYX_EXTERN_C
863 #define __PYX_EXTERN_C extern "C"
865 #define __PYX_EXTERN_C extern
869 #define __PYX_HAVE__imate___c_linear_operator__py_c_linear_operator
870 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_linear_operator
880 #include "pythread.h"
887 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
888 #define CYTHON_WITHOUT_ASSERTIONS
891 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
892 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
894 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
895 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
896 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
897 #define __PYX_DEFAULT_STRING_ENCODING ""
898 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
899 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
900 #define __Pyx_uchar_cast(c) ((unsigned char)c)
901 #define __Pyx_long_cast(x) ((long)x)
902 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
903 (sizeof(type) < sizeof(Py_ssize_t)) ||\
904 (sizeof(type) > sizeof(Py_ssize_t) &&\
905 likely(v < (type)PY_SSIZE_T_MAX ||\
906 v == (type)PY_SSIZE_T_MAX) &&\
907 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
908 v == (type)PY_SSIZE_T_MIN))) ||\
909 (sizeof(type) == sizeof(Py_ssize_t) &&\
910 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
911 v == (type)PY_SSIZE_T_MAX))) )
912 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
913 return (
size_t) i < (size_t) limit;
915 #if defined (__cplusplus) && __cplusplus >= 201103L
917 #define __Pyx_sst_abs(value) std::abs(value)
918 #elif SIZEOF_INT >= SIZEOF_SIZE_T
919 #define __Pyx_sst_abs(value) abs(value)
920 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
921 #define __Pyx_sst_abs(value) labs(value)
922 #elif defined (_MSC_VER)
923 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
924 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
925 #define __Pyx_sst_abs(value) llabs(value)
926 #elif defined (__GNUC__)
927 #define __Pyx_sst_abs(value) __builtin_llabs(value)
929 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
931 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
932 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
933 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
934 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
935 #define __Pyx_PyBytes_FromString PyBytes_FromString
936 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
937 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
938 #if PY_MAJOR_VERSION < 3
939 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
940 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
942 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
943 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
945 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
946 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
947 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
948 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
949 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
950 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
951 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
952 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
953 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
954 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
955 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
956 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
957 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
958 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
959 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
960 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
961 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
962 const Py_UNICODE *u_end = u;
964 return (
size_t)(u_end - u - 1);
966 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
967 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
968 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
969 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
970 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
971 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
972 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
973 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
974 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
975 #define __Pyx_PySequence_Tuple(obj)\
976 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
977 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
978 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
979 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
980 #if CYTHON_ASSUME_SAFE_MACROS
981 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
983 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
985 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
986 #if PY_MAJOR_VERSION >= 3
987 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
989 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
991 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
992 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
993 static int __Pyx_sys_getdefaultencoding_not_ascii;
994 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
996 PyObject* default_encoding = NULL;
997 PyObject* ascii_chars_u = NULL;
998 PyObject* ascii_chars_b = NULL;
999 const char* default_encoding_c;
1000 sys = PyImport_ImportModule(
"sys");
1002 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1004 if (!default_encoding)
goto bad;
1005 default_encoding_c = PyBytes_AsString(default_encoding);
1006 if (!default_encoding_c)
goto bad;
1007 if (strcmp(default_encoding_c,
"ascii") == 0) {
1008 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1010 char ascii_chars[128];
1012 for (c = 0; c < 128; c++) {
1015 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1016 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1017 if (!ascii_chars_u)
goto bad;
1018 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1019 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1022 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1023 default_encoding_c);
1026 Py_DECREF(ascii_chars_u);
1027 Py_DECREF(ascii_chars_b);
1029 Py_DECREF(default_encoding);
1032 Py_XDECREF(default_encoding);
1033 Py_XDECREF(ascii_chars_u);
1034 Py_XDECREF(ascii_chars_b);
1038 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1039 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1041 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1042 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1043 static char* __PYX_DEFAULT_STRING_ENCODING;
1044 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1046 PyObject* default_encoding = NULL;
1047 char* default_encoding_c;
1048 sys = PyImport_ImportModule(
"sys");
1050 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1052 if (!default_encoding)
goto bad;
1053 default_encoding_c = PyBytes_AsString(default_encoding);
1054 if (!default_encoding_c)
goto bad;
1055 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1056 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1057 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1058 Py_DECREF(default_encoding);
1061 Py_XDECREF(default_encoding);
1069 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1070 #define likely(x) __builtin_expect(!!(x), 1)
1071 #define unlikely(x) __builtin_expect(!!(x), 0)
1073 #define likely(x) (x)
1074 #define unlikely(x) (x)
1076 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1078 static PyObject *__pyx_m = NULL;
1079 static PyObject *__pyx_d;
1080 static PyObject *__pyx_b;
1081 static PyObject *__pyx_cython_runtime = NULL;
1082 static PyObject *__pyx_empty_tuple;
1083 static PyObject *__pyx_empty_bytes;
1084 static PyObject *__pyx_empty_unicode;
1085 static int __pyx_lineno;
1086 static int __pyx_clineno = 0;
1087 static const char * __pyx_cfilenm= __FILE__;
1088 static const char *__pyx_filename;
1091 static const char *__pyx_f[] = {
1092 "imate/_c_linear_operator/py_c_linear_operator.pyx",
1096 struct __pyx_memoryview_obj;
1098 struct __pyx_memoryview_obj *memview;
1100 Py_ssize_t shape[8];
1101 Py_ssize_t strides[8];
1102 Py_ssize_t suboffsets[8];
1103 } __Pyx_memviewslice;
1104 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1107 #include <pythread.h>
1108 #ifndef CYTHON_ATOMICS
1109 #define CYTHON_ATOMICS 1
1111 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1112 #define __pyx_atomic_int_type int
1113 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1114 (__GNUC_MINOR__ > 1 ||\
1115 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1116 #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1117 #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1118 #ifdef __PYX_DEBUG_ATOMICS
1119 #warning "Using GNU atomics"
1121 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1123 #undef __pyx_atomic_int_type
1124 #define __pyx_atomic_int_type long
1125 #pragma intrinsic (_InterlockedExchangeAdd)
1126 #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1127 #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1128 #ifdef __PYX_DEBUG_ATOMICS
1129 #pragma message ("Using MSVC atomics")
1132 #undef CYTHON_ATOMICS
1133 #define CYTHON_ATOMICS 0
1134 #ifdef __PYX_DEBUG_ATOMICS
1135 #warning "Not using atomics"
1138 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1140 #define __pyx_add_acquisition_count(memview)\
1141 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1142 #define __pyx_sub_acquisition_count(memview)\
1143 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1145 #define __pyx_add_acquisition_count(memview)\
1146 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1147 #define __pyx_sub_acquisition_count(memview)\
1148 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1152 #ifndef __PYX_FORCE_INIT_THREADS
1153 #define __PYX_FORCE_INIT_THREADS 0
1157 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1158 #define __Pyx_PyGILState_Release PyGILState_Release
1159 #define __Pyx_FastGIL_Remember()
1160 #define __Pyx_FastGIL_Forget()
1161 #define __Pyx_FastGilFuncInit()
1164 #define IS_UNSIGNED(type) (((type) -1) > 0)
1165 struct __Pyx_StructField_;
1166 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1169 struct __Pyx_StructField_* fields;
1171 size_t arraysize[8];
1177 typedef struct __Pyx_StructField_ {
1178 __Pyx_TypeInfo* type;
1181 } __Pyx_StructField;
1183 __Pyx_StructField* field;
1184 size_t parent_offset;
1185 } __Pyx_BufFmt_StackElem;
1187 __Pyx_StructField root;
1188 __Pyx_BufFmt_StackElem* head;
1190 size_t new_count, enc_count;
1191 size_t struct_alignment;
1196 char is_valid_array;
1197 } __Pyx_BufFmt_Context;
1207 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1216 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1219 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1220 struct __pyx_array_obj;
1221 struct __pyx_MemviewEnum_obj;
1222 struct __pyx_memoryview_obj;
1223 struct __pyx_memoryviewslice_obj;
1232 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1241 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1250 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1259 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1268 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1270 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1274 char *data_type_name;
1275 char *long_index_type_name;
1276 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1277 PyObject *parameters;
1288 struct __pyx_array_obj {
1290 struct __pyx_vtabstruct_array *__pyx_vtab;
1296 Py_ssize_t *_strides;
1297 Py_ssize_t itemsize;
1300 void (*callback_free_data)(
void *);
1302 int dtype_is_object;
1313 struct __pyx_MemviewEnum_obj {
1326 struct __pyx_memoryview_obj {
1328 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1331 PyObject *_array_interface;
1332 PyThread_type_lock lock;
1333 __pyx_atomic_int acquisition_count[2];
1334 __pyx_atomic_int *acquisition_count_aligned_p;
1337 int dtype_is_object;
1338 __Pyx_TypeInfo *typeinfo;
1349 struct __pyx_memoryviewslice_obj {
1350 struct __pyx_memoryview_obj __pyx_base;
1351 __Pyx_memviewslice from_slice;
1352 PyObject *from_object;
1353 PyObject *(*to_object_func)(
char *);
1354 int (*to_dtype_func)(
char *, PyObject *);
1367 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1368 LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1369 LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1370 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1371 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1372 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1373 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1374 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1376 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1387 struct __pyx_vtabstruct_array {
1388 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1390 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1401 struct __pyx_vtabstruct_memoryview {
1402 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1403 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1404 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1405 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1406 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1407 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1408 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1410 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1421 struct __pyx_vtabstruct__memoryviewslice {
1422 struct __pyx_vtabstruct_memoryview __pyx_base;
1424 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1428 #ifndef CYTHON_REFNANNY
1429 #define CYTHON_REFNANNY 0
1433 void (*INCREF)(
void*, PyObject*, int);
1434 void (*DECREF)(
void*, PyObject*, int);
1435 void (*GOTREF)(
void*, PyObject*, int);
1436 void (*GIVEREF)(
void*, PyObject*, int);
1437 void* (*SetupContext)(
const char*, int,
const char*);
1438 void (*FinishContext)(
void**);
1439 } __Pyx_RefNannyAPIStruct;
1440 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1441 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1442 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1444 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1446 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1447 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1448 PyGILState_Release(__pyx_gilstate_save);\
1450 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1453 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1454 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1456 #define __Pyx_RefNannyFinishContext()\
1457 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1458 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1459 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1460 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1461 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1462 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1463 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1464 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1465 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1467 #define __Pyx_RefNannyDeclarations
1468 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1469 #define __Pyx_RefNannyFinishContext()
1470 #define __Pyx_INCREF(r) Py_INCREF(r)
1471 #define __Pyx_DECREF(r) Py_DECREF(r)
1472 #define __Pyx_GOTREF(r)
1473 #define __Pyx_GIVEREF(r)
1474 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1475 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1476 #define __Pyx_XGOTREF(r)
1477 #define __Pyx_XGIVEREF(r)
1479 #define __Pyx_XDECREF_SET(r, v) do {\
1480 PyObject *tmp = (PyObject *) r;\
1481 r = v; __Pyx_XDECREF(tmp);\
1483 #define __Pyx_DECREF_SET(r, v) do {\
1484 PyObject *tmp = (PyObject *) r;\
1485 r = v; __Pyx_DECREF(tmp);\
1487 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1488 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1491 #if CYTHON_USE_TYPE_SLOTS
1492 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1494 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1498 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1501 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1502 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1505 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1508 #if CYTHON_FAST_THREAD_STATE
1509 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1510 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1511 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1513 #define __Pyx_PyThreadState_declare
1514 #define __Pyx_PyThreadState_assign
1515 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1519 #if CYTHON_FAST_THREAD_STATE
1520 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1521 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1522 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1523 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1524 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1525 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1526 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1527 #if CYTHON_COMPILING_IN_CPYTHON
1528 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1530 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1533 #define __Pyx_PyErr_Clear() PyErr_Clear()
1534 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1535 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1536 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1537 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1538 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1539 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1540 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1544 #ifndef CYTHON_PROFILE
1545 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1546 #define CYTHON_PROFILE 0
1548 #define CYTHON_PROFILE 1
1551 #ifndef CYTHON_TRACE_NOGIL
1552 #define CYTHON_TRACE_NOGIL 0
1554 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1555 #define CYTHON_TRACE 1
1558 #ifndef CYTHON_TRACE
1559 #define CYTHON_TRACE 0
1562 #undef CYTHON_PROFILE_REUSE_FRAME
1564 #ifndef CYTHON_PROFILE_REUSE_FRAME
1565 #define CYTHON_PROFILE_REUSE_FRAME 0
1567 #if CYTHON_PROFILE || CYTHON_TRACE
1568 #include "compile.h"
1569 #include "frameobject.h"
1570 #include "traceback.h"
1571 #if PY_VERSION_HEX >= 0x030b00a6
1572 #ifndef Py_BUILD_CORE
1573 #define Py_BUILD_CORE 1
1575 #include "internal/pycore_frame.h"
1577 #if CYTHON_PROFILE_REUSE_FRAME
1578 #define CYTHON_FRAME_MODIFIER static
1579 #define CYTHON_FRAME_DEL(frame)
1581 #define CYTHON_FRAME_MODIFIER
1582 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1584 #define __Pyx_TraceDeclarations\
1585 static PyCodeObject *__pyx_frame_code = NULL;\
1586 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1587 int __Pyx_use_tracing = 0;
1588 #define __Pyx_TraceFrameInit(codeobj)\
1589 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1590 #if PY_VERSION_HEX >= 0x030b00a2
1591 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1592 (unlikely((tstate)->cframe->use_tracing) &&\
1593 (!(check_tracing) || !(tstate)->tracing) &&\
1594 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1595 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1596 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1597 #elif PY_VERSION_HEX >= 0x030a00b1
1598 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1599 (unlikely((tstate)->cframe->use_tracing) &&\
1600 (!(check_tracing) || !(tstate)->tracing) &&\
1601 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1602 #define __Pyx_EnterTracing(tstate)\
1603 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1604 #define __Pyx_LeaveTracing(tstate)\
1607 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1608 || tstate->c_profilefunc != NULL);\
1611 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1612 (unlikely((tstate)->use_tracing) &&\
1613 (!(check_tracing) || !(tstate)->tracing) &&\
1614 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1615 #define __Pyx_EnterTracing(tstate)\
1616 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1617 #define __Pyx_LeaveTracing(tstate)\
1620 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1621 || tstate->c_profilefunc != NULL);\
1625 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1627 if (CYTHON_TRACE_NOGIL) {\
1628 PyThreadState *tstate;\
1629 PyGILState_STATE state = PyGILState_Ensure();\
1630 tstate = __Pyx_PyThreadState_Current;\
1631 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1632 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1634 PyGILState_Release(state);\
1635 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1638 PyThreadState* tstate = PyThreadState_GET();\
1639 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1640 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1641 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1645 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1646 { PyThreadState* tstate = PyThreadState_GET();\
1647 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1648 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1649 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1653 #define __Pyx_TraceException()\
1654 if (likely(!__Pyx_use_tracing)); else {\
1655 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1656 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1657 __Pyx_EnterTracing(tstate);\
1658 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1660 if (CYTHON_TRACE && tstate->c_tracefunc)\
1661 tstate->c_tracefunc(\
1662 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1663 tstate->c_profilefunc(\
1664 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1665 Py_DECREF(exc_info);\
1667 __Pyx_LeaveTracing(tstate);\
1670 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1671 PyObject *type, *value, *traceback;
1672 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1673 __Pyx_EnterTracing(tstate);
1674 if (CYTHON_TRACE && tstate->c_tracefunc)
1675 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1676 if (tstate->c_profilefunc)
1677 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1678 CYTHON_FRAME_DEL(frame);
1679 __Pyx_LeaveTracing(tstate);
1680 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1683 #define __Pyx_TraceReturn(result, nogil)\
1684 if (likely(!__Pyx_use_tracing)); else {\
1686 if (CYTHON_TRACE_NOGIL) {\
1687 PyThreadState *tstate;\
1688 PyGILState_STATE state = PyGILState_Ensure();\
1689 tstate = __Pyx_PyThreadState_Current;\
1690 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1691 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1693 PyGILState_Release(state);\
1696 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1697 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1698 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1703 #define __Pyx_TraceReturn(result, nogil)\
1704 if (likely(!__Pyx_use_tracing)); else {\
1705 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1706 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1707 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1711 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1712 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1714 #define __Pyx_TraceDeclarations
1715 #define __Pyx_TraceFrameInit(codeobj)
1716 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1717 #define __Pyx_TraceException()
1718 #define __Pyx_TraceReturn(result, nogil)
1721 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1723 PyObject *type, *value, *traceback;
1724 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1725 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1726 __Pyx_EnterTracing(tstate);
1727 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1728 __Pyx_LeaveTracing(tstate);
1730 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1734 Py_XDECREF(traceback);
1739 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1740 if (likely(!__Pyx_use_tracing)); else {\
1742 if (CYTHON_TRACE_NOGIL) {\
1744 PyThreadState *tstate;\
1745 PyGILState_STATE state = PyGILState_Ensure();\
1746 tstate = __Pyx_PyThreadState_Current;\
1747 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1748 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1750 PyGILState_Release(state);\
1751 if (unlikely(ret)) goto_error;\
1754 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1755 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1756 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1757 if (unlikely(ret)) goto_error;\
1762 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1763 if (likely(!__Pyx_use_tracing)); else {\
1764 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1765 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1766 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1767 if (unlikely(ret)) goto_error;\
1772 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1776 #if CYTHON_COMPILING_IN_CPYTHON
1777 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1779 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1783 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1786 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1787 int lineno,
const char *filename,
1788 int full_traceback,
int nogil);
1794 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1797 #if CYTHON_FAST_PYCCALL
1798 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1800 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1804 #if CYTHON_FAST_PYCALL
1805 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1806 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1807 #if 1 || PY_VERSION_HEX < 0x030600B1
1808 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1810 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1812 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1813 (sizeof(char [1 - 2*!(cond)]) - 1)
1814 #ifndef Py_MEMBER_SIZE
1815 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1817 #if CYTHON_FAST_PYCALL
1818 static size_t __pyx_pyframe_localsplus_offset = 0;
1819 #include "frameobject.h"
1820 #if PY_VERSION_HEX >= 0x030b00a6
1821 #ifndef Py_BUILD_CORE
1822 #define Py_BUILD_CORE 1
1824 #include "internal/pycore_frame.h"
1826 #define __Pxy_PyFrame_Initialize_Offsets()\
1827 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1828 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1829 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1830 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1835 #if CYTHON_COMPILING_IN_CPYTHON
1836 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1840 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1843 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1844 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1845 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1846 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1847 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1848 (cache_var) = (value);
1849 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1850 static PY_UINT64_T __pyx_dict_version = 0;\
1851 static PyObject *__pyx_dict_cached_value = NULL;\
1852 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1853 (VAR) = __pyx_dict_cached_value;\
1855 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1856 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1859 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1860 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1861 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1863 #define __PYX_GET_DICT_VERSION(dict) (0)
1864 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1865 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1869 #if CYTHON_USE_DICT_VERSIONS
1870 #define __Pyx_GetModuleGlobalName(var, name) do {\
1871 static PY_UINT64_T __pyx_dict_version = 0;\
1872 static PyObject *__pyx_dict_cached_value = NULL;\
1873 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1874 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1875 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1877 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1878 PY_UINT64_T __pyx_dict_version;\
1879 PyObject *__pyx_dict_cached_value;\
1880 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1882 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1884 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1885 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1886 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1890 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1893 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1896 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1897 #define __Pyx_MEMVIEW_DIRECT 1
1898 #define __Pyx_MEMVIEW_PTR 2
1899 #define __Pyx_MEMVIEW_FULL 4
1900 #define __Pyx_MEMVIEW_CONTIG 8
1901 #define __Pyx_MEMVIEW_STRIDED 16
1902 #define __Pyx_MEMVIEW_FOLLOW 32
1903 #define __Pyx_IS_C_CONTIG 1
1904 #define __Pyx_IS_F_CONTIG 2
1905 static int __Pyx_init_memviewslice(
1906 struct __pyx_memoryview_obj *memview,
1908 __Pyx_memviewslice *memviewslice,
1909 int memview_is_new_reference);
1910 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1911 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1912 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1913 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1914 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1915 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1916 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1917 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1918 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1919 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1922 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1925 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1926 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1927 const char* function_name);
1930 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1931 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1932 __Pyx__ArgTypeTest(obj, type, name, exact))
1933 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1936 #if PY_MAJOR_VERSION >= 3
1937 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1939 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1943 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1944 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1946 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1947 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1949 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1952 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1953 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1954 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1955 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1956 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1957 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1958 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1959 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1960 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1961 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1962 int wraparound,
int boundscheck);
1963 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1964 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1965 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1966 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1967 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1968 int wraparound,
int boundscheck);
1969 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1970 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1971 int is_list,
int wraparound,
int boundscheck);
1974 #if CYTHON_USE_TYPE_SLOTS
1975 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1977 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1981 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1983 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1985 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1987 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1989 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1991 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1995 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1996 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1997 const char* encoding,
const char* errors,
1998 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
2001 #if CYTHON_FAST_THREAD_STATE
2002 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2003 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2005 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2009 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2012 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2015 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2018 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
2021 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2024 #if CYTHON_USE_EXC_INFO_STACK
2025 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2029 #if CYTHON_FAST_THREAD_STATE
2030 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2031 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2032 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2033 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2035 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2036 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2040 #if CYTHON_FAST_THREAD_STATE
2041 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2042 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2044 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2048 #if CYTHON_FAST_THREAD_STATE
2049 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2050 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2052 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2056 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
2059 #if CYTHON_COMPILING_IN_CPYTHON
2060 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2061 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2062 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2063 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2065 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2066 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2067 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2069 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2071 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2073 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2074 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2075 PyListObject* L = (PyListObject*) list;
2076 Py_ssize_t len = Py_SIZE(list);
2077 if (likely(L->allocated > len)) {
2079 PyList_SET_ITEM(list, len, x);
2080 __Pyx_SET_SIZE(list, len + 1);
2083 return PyList_Append(list, x);
2086 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2090 #if !CYTHON_COMPILING_IN_PYPY
2091 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
2093 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2094 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2098 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2099 #if CYTHON_COMPILING_IN_CPYTHON
2100 PyObject* none = _PyList_Extend((PyListObject*)L, v);
2101 if (unlikely(!none))
2106 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2111 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2112 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2113 PyListObject* L = (PyListObject*) list;
2114 Py_ssize_t len = Py_SIZE(list);
2115 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2117 PyList_SET_ITEM(list, len, x);
2118 __Pyx_SET_SIZE(list, len + 1);
2121 return PyList_Append(list, x);
2124 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2128 #define __Pyx_init_assertions_enabled()
2129 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2130 #define __pyx_assertions_enabled() (1)
2131 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2132 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2133 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2134 static int __pyx_assertions_enabled_flag;
2135 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2136 #undef __Pyx_init_assertions_enabled
2137 static void __Pyx_init_assertions_enabled(
void) {
2138 __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2141 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2145 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2148 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2149 int result = PySequence_Contains(seq, item);
2150 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2154 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2157 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2160 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2161 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2163 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2167 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2168 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2170 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2174 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2177 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2180 static int __Pyx_setup_reduce(PyObject* type_obj);
2183 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2186 #define __Pyx_CyFunction_USED 1
2187 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2188 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2189 #define __Pyx_CYFUNCTION_CCLASS 0x04
2190 #define __Pyx_CyFunction_GetClosure(f)\
2191 (((__pyx_CyFunctionObject *) (f))->func_closure)
2192 #define __Pyx_CyFunction_GetClassObj(f)\
2193 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2194 #define __Pyx_CyFunction_Defaults(type, f)\
2195 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2196 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2197 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2199 PyCFunctionObject func;
2200 #if PY_VERSION_HEX < 0x030500A0
2201 PyObject *func_weakreflist;
2203 PyObject *func_dict;
2204 PyObject *func_name;
2205 PyObject *func_qualname;
2207 PyObject *func_globals;
2208 PyObject *func_code;
2209 PyObject *func_closure;
2210 PyObject *func_classobj;
2212 int defaults_pyobjects;
2213 size_t defaults_size;
2215 PyObject *defaults_tuple;
2216 PyObject *defaults_kwdict;
2217 PyObject *(*defaults_getter)(PyObject *);
2218 PyObject *func_annotations;
2219 } __pyx_CyFunctionObject;
2220 static PyTypeObject *__pyx_CyFunctionType = 0;
2221 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2222 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2223 int flags, PyObject* qualname,
2225 PyObject *module, PyObject *globals,
2227 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2230 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2232 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2234 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2236 static int __pyx_CyFunction_init(
void);
2239 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2240 int flags, PyObject* qualname,
2242 PyObject *module, PyObject *globals,
2246 #ifdef CYTHON_CLINE_IN_TRACEBACK
2247 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2249 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2254 PyCodeObject* code_object;
2256 } __Pyx_CodeObjectCacheEntry;
2257 struct __Pyx_CodeObjectCache {
2260 __Pyx_CodeObjectCacheEntry* entries;
2262 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2263 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2264 static PyCodeObject *__pyx_find_code_object(
int code_line);
2265 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2268 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2269 int py_line,
const char *filename);
2271 #if PY_MAJOR_VERSION < 3
2272 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2273 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2275 #define __Pyx_GetBuffer PyObject_GetBuffer
2276 #define __Pyx_ReleaseBuffer PyBuffer_Release
2282 Py_ssize_t shape, strides, suboffsets;
2283 } __Pyx_Buf_DimInfo;
2289 __Pyx_Buffer *rcbuffer;
2291 __Pyx_Buf_DimInfo diminfo[8];
2292 } __Pyx_LocalBuf_ND;
2295 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2298 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2299 __Pyx_memviewslice *slice2,
2300 int ndim,
size_t itemsize);
2303 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2306 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2307 #define __Pyx_HAS_GCC_DIAGNOSTIC
2311 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2314 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2315 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2316 __Pyx_BufFmt_StackElem* stack,
2317 __Pyx_TypeInfo* type);
2320 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2323 static int __Pyx_ValidateAndInit_memviewslice(
2328 __Pyx_TypeInfo *dtype,
2329 __Pyx_BufFmt_StackElem stack[],
2330 __Pyx_memviewslice *memviewslice,
2331 PyObject *original_obj);
2334 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2337 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2340 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2343 static __Pyx_memviewslice
2344 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2345 const char *mode,
int ndim,
2346 size_t sizeof_dtype,
int contig_flag,
2347 int dtype_is_object);
2350 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2353 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2356 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2359 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2362 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2365 static int __Pyx_check_binary_version(
void);
2368 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2370 static LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2371 static LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2372 static cLinearOperator<float> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2373 static cLinearOperator<double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2374 static cLinearOperator<long double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2375 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch);
2376 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch);
2377 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2378 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2379 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2380 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2381 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2382 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2383 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2384 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2385 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2386 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2397 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2398 static PyTypeObject *__pyx_array_type = 0;
2399 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2400 static PyTypeObject *__pyx_memoryview_type = 0;
2401 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2402 static PyObject *
generic = 0;
2403 static PyObject *strided = 0;
2404 static PyObject *indirect = 0;
2405 static PyObject *contiguous = 0;
2406 static PyObject *indirect_contiguous = 0;
2407 static int __pyx_memoryview_thread_locks_used;
2408 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2409 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2410 static void *__pyx_align_pointer(
void *,
size_t);
2411 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2412 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2413 static PyObject *_unellipsify(PyObject *,
int);
2414 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2415 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2416 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2417 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2418 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2419 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2420 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2421 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2422 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2423 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2424 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2425 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2426 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2427 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2428 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2429 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2430 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2431 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2432 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2433 static int __pyx_memoryview_err(PyObject *,
char *);
2434 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2435 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2436 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2437 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2438 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2439 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2440 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2441 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2442 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2443 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2444 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2445 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_linear_operator"
2446 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator;
2447 int __pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator = 0;
2450 static PyObject *__pyx_builtin_TypeError;
2451 static PyObject *__pyx_builtin_ValueError;
2452 static PyObject *__pyx_builtin_RuntimeError;
2453 static PyObject *__pyx_builtin_MemoryError;
2454 static PyObject *__pyx_builtin_enumerate;
2455 static PyObject *__pyx_builtin_range;
2456 static PyObject *__pyx_builtin_Ellipsis;
2457 static PyObject *__pyx_builtin_id;
2458 static PyObject *__pyx_builtin_IndexError;
2459 static const char __pyx_k_O[] =
"O";
2460 static const char __pyx_k_c[] =
"c";
2461 static const char __pyx_k_id[] =
"id";
2462 static const char __pyx_k_dot[] =
"dot";
2463 static const char __pyx_k_new[] =
"__new__";
2464 static const char __pyx_k_obj[] =
"obj";
2465 static const char __pyx_k_base[] =
"base";
2466 static const char __pyx_k_dict[] =
"__dict__";
2467 static const char __pyx_k_main[] =
"__main__";
2468 static const char __pyx_k_mode[] =
"mode";
2469 static const char __pyx_k_name[] =
"name";
2470 static const char __pyx_k_ndim[] =
"ndim";
2471 static const char __pyx_k_pack[] =
"pack";
2472 static const char __pyx_k_self[] =
"self";
2473 static const char __pyx_k_size[] =
"size";
2474 static const char __pyx_k_step[] =
"step";
2475 static const char __pyx_k_stop[] =
"stop";
2476 static const char __pyx_k_test[] =
"__test__";
2477 static const char __pyx_k_ASCII[] =
"ASCII";
2478 static const char __pyx_k_array[] =
"array";
2479 static const char __pyx_k_class[] =
"__class__";
2480 static const char __pyx_k_dtype[] =
"dtype";
2481 static const char __pyx_k_error[] =
"error";
2482 static const char __pyx_k_flags[] =
"flags";
2483 static const char __pyx_k_numpy[] =
"numpy";
2484 static const char __pyx_k_range[] =
"range";
2485 static const char __pyx_k_shape[] =
"shape";
2486 static const char __pyx_k_start[] =
"start";
2487 static const char __pyx_k_astype[] =
"astype";
2488 static const char __pyx_k_encode[] =
"encode";
2489 static const char __pyx_k_format[] =
"format";
2490 static const char __pyx_k_import[] =
"__import__";
2491 static const char __pyx_k_name_2[] =
"__name__";
2492 static const char __pyx_k_pickle[] =
"pickle";
2493 static const char __pyx_k_reduce[] =
"__reduce__";
2494 static const char __pyx_k_struct[] =
"struct";
2495 static const char __pyx_k_unpack[] =
"unpack";
2496 static const char __pyx_k_update[] =
"update";
2497 static const char __pyx_k_vector[] =
"vector";
2498 static const char __pyx_k_float32[] =
"float32";
2499 static const char __pyx_k_float64[] =
"float64";
2500 static const char __pyx_k_fortran[] =
"fortran";
2501 static const char __pyx_k_memview[] =
"memview";
2502 static const char __pyx_k_product[] =
"product";
2503 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2504 static const char __pyx_k_float128[] =
"float128";
2505 static const char __pyx_k_getstate[] =
"__getstate__";
2506 static const char __pyx_k_isscalar[] =
"isscalar";
2507 static const char __pyx_k_itemsize[] =
"itemsize";
2508 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2509 static const char __pyx_k_setstate[] =
"__setstate__";
2510 static const char __pyx_k_TypeError[] =
"TypeError";
2511 static const char __pyx_k_enumerate[] =
"enumerate";
2512 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2513 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2514 static const char __pyx_k_IndexError[] =
"IndexError";
2515 static const char __pyx_k_ValueError[] =
"ValueError";
2516 static const char __pyx_k_parameters[] =
"parameters_";
2517 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2518 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2519 static const char __pyx_k_MemoryError[] =
"MemoryError";
2520 static const char __pyx_k_PickleError[] =
"PickleError";
2521 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2522 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2523 static const char __pyx_k_stringsource[] =
"stringsource";
2524 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2525 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2526 static const char __pyx_k_transpose_dot[] =
"transpose_dot";
2527 static const char __pyx_k_set_parameters[] =
"set_parameters";
2528 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2529 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2530 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2531 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2532 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2533 static const char __pyx_k_pycLinearOperator[] =
"pycLinearOperator";
2534 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2535 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2536 static const char __pyx_k_get_data_type_name[] =
"get_data_type_name";
2537 static const char __pyx_k_get_num_parameters[] =
"get_num_parameters";
2538 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2539 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2540 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2541 static const char __pyx_k_pycLinearOperator_dot[] =
"pycLinearOperator.dot";
2542 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2543 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2544 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2545 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2546 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2547 static const char __pyx_k_LinearOperator_object_is_s[] =
"LinearOperator object is: %s";
2548 static const char __pyx_k_Linear_operator_is_not_set[] =
"Linear operator is not set.";
2549 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2550 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2551 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2552 static const char __pyx_k_LongIndexType_has_an_unconventi[] =
"\"LongIndexType\" has an unconventional byte size.";
2553 static const char __pyx_k_pycLinearOperator_get_data_type[] =
"pycLinearOperator.get_data_type_name";
2554 static const char __pyx_k_pycLinearOperator_transpose_dot[] =
"pycLinearOperator.transpose_dot";
2555 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2556 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2557 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2558 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2559 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2560 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2561 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2562 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2563 static const char __pyx_k_Linear_operator_data_type_is_not[] =
"Linear operator data type is not set.";
2564 static const char __pyx_k_Linear_operator_double_type_is_n[] =
"Linear operator (double type) is not set.";
2565 static const char __pyx_k_Linear_operator_float_type_is_no[] =
"Linear operator (float type) is not set.";
2566 static const char __pyx_k_Linear_operator_long_double_type[] =
"Linear operator (long double type) is not set.";
2567 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2568 static const char __pyx_k_The_input_vector_and_product_sho[] =
"The input vector and product should have ";
2569 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2570 static const char __pyx_k_Vector_type_should_be_either_flo[] =
"Vector type should be either \"float32\", \"float64\", or \"float128\".";
2571 static const char __pyx_k_Wrong_accessors_is_called_The_ty[] =
"Wrong accessors is called. The type of the ";
2572 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2573 static const char __pyx_k_imate__c_linear_operator_py_c_li[] =
"imate/_c_linear_operator/py_c_linear_operator.pyx";
2574 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2575 static const char __pyx_k_pycLinearOperator___reduce_cytho[] =
"pycLinearOperator.__reduce_cython__";
2576 static const char __pyx_k_pycLinearOperator___setstate_cyt[] =
"pycLinearOperator.__setstate_cython__";
2577 static const char __pyx_k_pycLinearOperator_get_num_parame[] =
"pycLinearOperator.get_num_parameters";
2578 static const char __pyx_k_pycLinearOperator_set_parameters[] =
"pycLinearOperator.set_parameters";
2579 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2580 static const char __pyx_k_imate__c_linear_operator_py_c_li_2[] =
"imate._c_linear_operator.py_c_linear_operator";
2581 static PyObject *__pyx_n_s_ASCII;
2582 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2583 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2584 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2585 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2586 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2587 static PyObject *__pyx_n_s_Ellipsis;
2588 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2589 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2590 static PyObject *__pyx_n_s_IndexError;
2591 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2592 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2593 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2594 static PyObject *__pyx_kp_u_LinearOperator_object_is_s;
2595 static PyObject *__pyx_kp_u_Linear_operator_data_type_is_not;
2596 static PyObject *__pyx_kp_u_Linear_operator_double_type_is_n;
2597 static PyObject *__pyx_kp_u_Linear_operator_float_type_is_no;
2598 static PyObject *__pyx_kp_u_Linear_operator_is_not_set;
2599 static PyObject *__pyx_kp_u_Linear_operator_long_double_type;
2600 static PyObject *__pyx_kp_u_LongIndexType_has_an_unconventi;
2601 static PyObject *__pyx_n_s_MemoryError;
2602 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2603 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2604 static PyObject *__pyx_n_b_O;
2605 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2606 static PyObject *__pyx_n_s_PickleError;
2607 static PyObject *__pyx_n_s_RuntimeError;
2608 static PyObject *__pyx_kp_u_The_input_vector_and_product_sho;
2609 static PyObject *__pyx_n_s_TypeError;
2610 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2611 static PyObject *__pyx_n_s_ValueError;
2612 static PyObject *__pyx_kp_u_Vector_type_should_be_either_flo;
2613 static PyObject *__pyx_n_s_View_MemoryView;
2614 static PyObject *__pyx_kp_u_Wrong_accessors_is_called_The_ty;
2615 static PyObject *__pyx_n_s_allocate_buffer;
2616 static PyObject *__pyx_n_s_array;
2617 static PyObject *__pyx_n_s_astype;
2618 static PyObject *__pyx_n_s_base;
2619 static PyObject *__pyx_n_s_c;
2620 static PyObject *__pyx_n_u_c;
2621 static PyObject *__pyx_n_s_class;
2622 static PyObject *__pyx_n_s_cline_in_traceback;
2623 static PyObject *__pyx_kp_s_contiguous_and_direct;
2624 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2625 static PyObject *__pyx_n_s_dict;
2626 static PyObject *__pyx_n_s_dot;
2627 static PyObject *__pyx_n_s_dtype;
2628 static PyObject *__pyx_n_s_dtype_is_object;
2629 static PyObject *__pyx_n_s_encode;
2630 static PyObject *__pyx_n_s_enumerate;
2631 static PyObject *__pyx_n_s_error;
2632 static PyObject *__pyx_n_s_flags;
2633 static PyObject *__pyx_n_b_float128;
2634 static PyObject *__pyx_n_u_float128;
2635 static PyObject *__pyx_n_b_float32;
2636 static PyObject *__pyx_n_u_float32;
2637 static PyObject *__pyx_n_b_float64;
2638 static PyObject *__pyx_n_u_float64;
2639 static PyObject *__pyx_n_s_format;
2640 static PyObject *__pyx_n_s_fortran;
2641 static PyObject *__pyx_n_u_fortran;
2642 static PyObject *__pyx_n_s_get_data_type_name;
2643 static PyObject *__pyx_n_s_get_num_parameters;
2644 static PyObject *__pyx_n_s_getstate;
2645 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2646 static PyObject *__pyx_n_s_id;
2647 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_li;
2648 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_li_2;
2649 static PyObject *__pyx_n_s_import;
2650 static PyObject *__pyx_n_s_isscalar;
2651 static PyObject *__pyx_n_s_itemsize;
2652 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2653 static PyObject *__pyx_n_s_main;
2654 static PyObject *__pyx_n_s_memview;
2655 static PyObject *__pyx_n_s_mode;
2656 static PyObject *__pyx_n_s_name;
2657 static PyObject *__pyx_n_s_name_2;
2658 static PyObject *__pyx_n_s_ndim;
2659 static PyObject *__pyx_n_s_new;
2660 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2661 static PyObject *__pyx_n_s_numpy;
2662 static PyObject *__pyx_n_s_obj;
2663 static PyObject *__pyx_n_s_pack;
2664 static PyObject *__pyx_n_s_parameters;
2665 static PyObject *__pyx_n_s_pickle;
2666 static PyObject *__pyx_n_s_product;
2667 static PyObject *__pyx_n_s_pycLinearOperator;
2668 static PyObject *__pyx_n_s_pycLinearOperator___reduce_cytho;
2669 static PyObject *__pyx_n_s_pycLinearOperator___setstate_cyt;
2670 static PyObject *__pyx_n_s_pycLinearOperator_dot;
2671 static PyObject *__pyx_n_s_pycLinearOperator_get_data_type;
2672 static PyObject *__pyx_n_s_pycLinearOperator_get_num_parame;
2673 static PyObject *__pyx_n_s_pycLinearOperator_set_parameters;
2674 static PyObject *__pyx_n_s_pycLinearOperator_transpose_dot;
2675 static PyObject *__pyx_n_s_pyx_PickleError;
2676 static PyObject *__pyx_n_s_pyx_checksum;
2677 static PyObject *__pyx_n_s_pyx_getbuffer;
2678 static PyObject *__pyx_n_s_pyx_result;
2679 static PyObject *__pyx_n_s_pyx_state;
2680 static PyObject *__pyx_n_s_pyx_type;
2681 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2682 static PyObject *__pyx_n_s_pyx_vtable;
2683 static PyObject *__pyx_n_s_range;
2684 static PyObject *__pyx_n_s_reduce;
2685 static PyObject *__pyx_n_s_reduce_cython;
2686 static PyObject *__pyx_n_s_reduce_ex;
2687 static PyObject *__pyx_n_s_self;
2688 static PyObject *__pyx_n_s_set_parameters;
2689 static PyObject *__pyx_n_s_setstate;
2690 static PyObject *__pyx_n_s_setstate_cython;
2691 static PyObject *__pyx_n_s_shape;
2692 static PyObject *__pyx_n_s_size;
2693 static PyObject *__pyx_n_s_start;
2694 static PyObject *__pyx_n_s_step;
2695 static PyObject *__pyx_n_s_stop;
2696 static PyObject *__pyx_kp_s_strided_and_direct;
2697 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2698 static PyObject *__pyx_kp_s_strided_and_indirect;
2699 static PyObject *__pyx_kp_s_stringsource;
2700 static PyObject *__pyx_n_s_struct;
2701 static PyObject *__pyx_n_s_test;
2702 static PyObject *__pyx_n_s_transpose_dot;
2703 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2704 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2705 static PyObject *__pyx_n_s_unpack;
2706 static PyObject *__pyx_n_s_update;
2707 static PyObject *__pyx_n_s_vector;
2708 static int __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2709 static void __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2710 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2711 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2712 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_parameters_);
2713 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product);
2714 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product);
2715 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self);
2716 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2717 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2718 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2719 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2720 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2721 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2722 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2723 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2724 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2725 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2726 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2727 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2728 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2729 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2730 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2731 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2732 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2733 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2734 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2735 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2736 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2737 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2738 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2739 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2740 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2741 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2742 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2743 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2744 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2745 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2746 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2747 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2748 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2749 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2750 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2751 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2752 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2753 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2754 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2755 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2756 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2757 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2758 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2759 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyTypeObject *t, PyObject *a, PyObject *k);
2760 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2761 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2762 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2763 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2764 static PyObject *__pyx_int_0;
2765 static PyObject *__pyx_int_1;
2766 static PyObject *__pyx_int_112105877;
2767 static PyObject *__pyx_int_136983863;
2768 static PyObject *__pyx_int_184977713;
2769 static PyObject *__pyx_int_neg_1;
2770 static PyObject *__pyx_tuple_;
2771 static PyObject *__pyx_tuple__2;
2772 static PyObject *__pyx_tuple__5;
2773 static PyObject *__pyx_tuple__6;
2774 static PyObject *__pyx_tuple__7;
2775 static PyObject *__pyx_tuple__8;
2776 static PyObject *__pyx_slice__32;
2777 static PyObject *__pyx_tuple__11;
2778 static PyObject *__pyx_tuple__12;
2779 static PyObject *__pyx_tuple__15;
2780 static PyObject *__pyx_tuple__17;
2781 static PyObject *__pyx_tuple__18;
2782 static PyObject *__pyx_tuple__19;
2783 static PyObject *__pyx_tuple__20;
2784 static PyObject *__pyx_tuple__21;
2785 static PyObject *__pyx_tuple__22;
2786 static PyObject *__pyx_tuple__23;
2787 static PyObject *__pyx_tuple__24;
2788 static PyObject *__pyx_tuple__25;
2789 static PyObject *__pyx_tuple__26;
2790 static PyObject *__pyx_tuple__27;
2791 static PyObject *__pyx_tuple__28;
2792 static PyObject *__pyx_tuple__29;
2793 static PyObject *__pyx_tuple__30;
2794 static PyObject *__pyx_tuple__31;
2795 static PyObject *__pyx_tuple__33;
2796 static PyObject *__pyx_tuple__34;
2797 static PyObject *__pyx_tuple__35;
2798 static PyObject *__pyx_tuple__37;
2799 static PyObject *__pyx_tuple__38;
2800 static PyObject *__pyx_tuple__39;
2801 static PyObject *__pyx_tuple__40;
2802 static PyObject *__pyx_tuple__41;
2803 static PyObject *__pyx_tuple__42;
2804 static PyObject *__pyx_tuple__43;
2805 static PyObject *__pyx_tuple__44;
2806 static PyObject *__pyx_tuple__45;
2807 static PyObject *__pyx_tuple__46;
2808 static PyObject *__pyx_tuple__47;
2809 static PyObject *__pyx_tuple__48;
2810 static PyObject *__pyx_tuple__49;
2811 static PyObject *__pyx_tuple__50;
2812 static PyObject *__pyx_codeobj__3;
2813 static PyObject *__pyx_codeobj__4;
2814 static PyObject *__pyx_codeobj__9;
2815 static PyObject *__pyx_codeobj__10;
2816 static PyObject *__pyx_codeobj__13;
2817 static PyObject *__pyx_codeobj__14;
2818 static PyObject *__pyx_codeobj__16;
2819 static PyObject *__pyx_codeobj__36;
2831 static int __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2832 static int __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2834 __Pyx_RefNannyDeclarations
2835 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2836 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2837 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
2838 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__cinit__", 0)))
return -1;
2839 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
2842 __Pyx_RefNannyFinishContext();
2846 static int __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
2848 int __pyx_v_unsigned_type;
2850 __Pyx_TraceDeclarations
2851 __Pyx_RefNannyDeclarations
2853 PyObject *__pyx_t_2 = NULL;
2854 int __pyx_lineno = 0;
2855 const char *__pyx_filename = NULL;
2856 int __pyx_clineno = 0;
2857 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2858 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 34, 0, __PYX_ERR(0, 34, __pyx_L1_error));
2867 __Pyx_TraceLine(40,0,__PYX_ERR(0, 40, __pyx_L1_error))
2868 __pyx_v_self->Aop_float = NULL;
2877 __Pyx_TraceLine(41,0,__PYX_ERR(0, 41, __pyx_L1_error))
2878 __pyx_v_self->Aop_double = NULL;
2887 __Pyx_TraceLine(42,0,__PYX_ERR(0, 42, __pyx_L1_error))
2888 __pyx_v_self->Aop_long_double = NULL;
2897 __Pyx_TraceLine(43,0,__PYX_ERR(0, 43, __pyx_L1_error))
2898 __pyx_v_self->data_type_name = NULL;
2907 __Pyx_TraceLine(44,0,__PYX_ERR(0, 44, __pyx_L1_error))
2908 __pyx_v_self->long_index_type_name = NULL;
2917 __Pyx_TraceLine(45,0,__PYX_ERR(0, 45, __pyx_L1_error))
2918 __Pyx_INCREF(Py_None);
2919 __Pyx_GIVEREF(Py_None);
2920 __Pyx_GOTREF(__pyx_v_self->parameters);
2921 __Pyx_DECREF(__pyx_v_self->parameters);
2922 __pyx_v_self->parameters = Py_None;
2931 __Pyx_TraceLine(49,0,__PYX_ERR(0, 49, __pyx_L1_error))
2932 __pyx_v_long_index = -1;
2941 __Pyx_TraceLine(50,0,__PYX_ERR(0, 50, __pyx_L1_error))
2942 __pyx_t_1 = ((__pyx_v_long_index < 1) != 0);
2952 __Pyx_TraceLine(51,0,__PYX_ERR(0, 51, __pyx_L1_error))
2953 __pyx_v_unsigned_type = 0;
2972 __Pyx_TraceLine(53,0,__PYX_ERR(0, 53, __pyx_L1_error))
2974 __pyx_v_unsigned_type = 1;
2985 __Pyx_TraceLine(56,0,__PYX_ERR(0, 56, __pyx_L1_error))
2996 __Pyx_TraceLine(57,0,__PYX_ERR(0, 57, __pyx_L1_error))
2997 __pyx_t_1 = (__pyx_v_unsigned_type != 0);
3007 __Pyx_TraceLine(58,0,__PYX_ERR(0, 58, __pyx_L1_error))
3008 __pyx_v_self->long_index_type_name = ((
char *)
"uint32");
3027 __Pyx_TraceLine(60,0,__PYX_ERR(0, 60, __pyx_L1_error))
3029 __pyx_v_self->long_index_type_name = ((
char *)
"int32");
3050 __Pyx_TraceLine(61,0,__PYX_ERR(0, 61, __pyx_L1_error))
3052 if (likely(__pyx_t_1)) {
3061 __Pyx_TraceLine(62,0,__PYX_ERR(0, 62, __pyx_L1_error))
3062 __pyx_t_1 = (__pyx_v_unsigned_type != 0);
3072 __Pyx_TraceLine(63,0,__PYX_ERR(0, 63, __pyx_L1_error))
3073 __pyx_v_self->long_index_type_name = ((
char *)
"uint64");
3092 __Pyx_TraceLine(65,0,__PYX_ERR(0, 65, __pyx_L1_error))
3094 __pyx_v_self->long_index_type_name = ((
char *)
"int64");
3115 __Pyx_TraceLine(67,0,__PYX_ERR(0, 67, __pyx_L1_error))
3117 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
3118 __Pyx_GOTREF(__pyx_t_2);
3119 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3121 __PYX_ERR(0, 67, __pyx_L1_error)
3137 __Pyx_XDECREF(__pyx_t_2);
3138 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3141 __Pyx_TraceReturn(Py_None, 0);
3142 __Pyx_RefNannyFinishContext();
3155 static void __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(PyObject *__pyx_v_self);
3156 static void __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(PyObject *__pyx_v_self) {
3157 __Pyx_RefNannyDeclarations
3158 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3159 __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
3162 __Pyx_RefNannyFinishContext();
3165 static void __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_2__dealloc__(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3166 __Pyx_TraceDeclarations
3167 __Pyx_RefNannyDeclarations
3169 int __pyx_lineno = 0;
3170 const char *__pyx_filename = NULL;
3171 int __pyx_clineno = 0;
3172 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3173 __Pyx_TraceCall(
"__dealloc__", __pyx_f[0], 73, 0, __PYX_ERR(0, 73, __pyx_L1_error));
3182 __Pyx_TraceLine(77,0,__PYX_ERR(0, 77, __pyx_L1_error))
3183 __pyx_t_1 = ((__pyx_v_self->Aop_float != NULL) != 0);
3193 __Pyx_TraceLine(78,0,__PYX_ERR(0, 78, __pyx_L1_error))
3194 delete __pyx_v_self->Aop_float;
3203 __Pyx_TraceLine(79,0,__PYX_ERR(0, 79, __pyx_L1_error))
3204 __pyx_v_self->Aop_float = NULL;
3222 __Pyx_TraceLine(81,0,__PYX_ERR(0, 81, __pyx_L1_error))
3223 __pyx_t_1 = ((__pyx_v_self->Aop_double != NULL) != 0);
3233 __Pyx_TraceLine(82,0,__PYX_ERR(0, 82, __pyx_L1_error))
3234 delete __pyx_v_self->Aop_double;
3243 __Pyx_TraceLine(83,0,__PYX_ERR(0, 83, __pyx_L1_error))
3244 __pyx_v_self->Aop_double = NULL;
3262 __Pyx_TraceLine(85,0,__PYX_ERR(0, 85, __pyx_L1_error))
3263 __pyx_t_1 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3273 __Pyx_TraceLine(86,0,__PYX_ERR(0, 86, __pyx_L1_error))
3274 delete __pyx_v_self->Aop_long_double;
3283 __Pyx_TraceLine(87,0,__PYX_ERR(0, 87, __pyx_L1_error))
3284 __pyx_v_self->Aop_long_double = NULL;
3306 __Pyx_WriteUnraisable(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3308 __Pyx_TraceReturn(Py_None, 0);
3309 __Pyx_RefNannyFinishContext();
3320 static LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3322 __Pyx_TraceDeclarations
3323 __Pyx_RefNannyDeclarations
3325 PyObject *__pyx_t_2 = NULL;
3327 int __pyx_lineno = 0;
3328 const char *__pyx_filename = NULL;
3329 int __pyx_clineno = 0;
3330 __Pyx_RefNannySetupContext(
"get_num_rows", 0);
3331 __Pyx_TraceCall(
"get_num_rows", __pyx_f[0], 93, 0, __PYX_ERR(0, 93, __pyx_L1_error));
3340 __Pyx_TraceLine(99,0,__PYX_ERR(0, 99, __pyx_L1_error))
3341 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
3342 __Pyx_GOTREF(__pyx_t_2);
3343 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 99, __pyx_L1_error)
3344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3347 __pyx_t_1 = __pyx_t_3;
3348 goto __pyx_L4_bool_binop_done;
3350 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3351 __pyx_t_1 = __pyx_t_3;
3352 __pyx_L4_bool_binop_done:;
3362 __Pyx_TraceLine(100,0,__PYX_ERR(0, 100, __pyx_L1_error))
3363 __pyx_r = __pyx_v_self->Aop_float->get_num_rows();
3382 __Pyx_TraceLine(101,0,__PYX_ERR(0, 101, __pyx_L1_error))
3383 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
3384 __Pyx_GOTREF(__pyx_t_2);
3385 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 101, __pyx_L1_error)
3386 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3389 __pyx_t_1 = __pyx_t_3;
3390 goto __pyx_L6_bool_binop_done;
3392 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3393 __pyx_t_1 = __pyx_t_3;
3394 __pyx_L6_bool_binop_done:;
3404 __Pyx_TraceLine(102,0,__PYX_ERR(0, 102, __pyx_L1_error))
3405 __pyx_r = __pyx_v_self->Aop_double->get_num_rows();
3424 __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3425 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
3426 __Pyx_GOTREF(__pyx_t_2);
3427 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
3428 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3431 __pyx_t_1 = __pyx_t_3;
3432 goto __pyx_L8_bool_binop_done;
3442 __Pyx_TraceLine(104,0,__PYX_ERR(0, 104, __pyx_L1_error))
3443 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3444 __pyx_t_1 = __pyx_t_3;
3445 __pyx_L8_bool_binop_done:;
3454 __Pyx_TraceLine(103,0,__PYX_ERR(0, 103, __pyx_L1_error))
3455 if (likely(__pyx_t_1)) {
3464 __Pyx_TraceLine(105,0,__PYX_ERR(0, 105, __pyx_L1_error))
3465 __pyx_r = __pyx_v_self->Aop_long_double->get_num_rows();
3484 __Pyx_TraceLine(107,0,__PYX_ERR(0, 107, __pyx_L1_error))
3486 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
3487 __Pyx_GOTREF(__pyx_t_2);
3488 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3489 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3490 __PYX_ERR(0, 107, __pyx_L1_error)
3503 __Pyx_XDECREF(__pyx_t_2);
3504 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_rows", __pyx_clineno, __pyx_lineno, __pyx_filename);
3507 __Pyx_TraceReturn(Py_None, 0);
3508 __Pyx_RefNannyFinishContext();
3520 static LongIndexType __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3522 __Pyx_TraceDeclarations
3523 __Pyx_RefNannyDeclarations
3525 PyObject *__pyx_t_2 = NULL;
3527 int __pyx_lineno = 0;
3528 const char *__pyx_filename = NULL;
3529 int __pyx_clineno = 0;
3530 __Pyx_RefNannySetupContext(
"get_num_columns", 0);
3531 __Pyx_TraceCall(
"get_num_columns", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
3540 __Pyx_TraceLine(119,0,__PYX_ERR(0, 119, __pyx_L1_error))
3541 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3542 __Pyx_GOTREF(__pyx_t_2);
3543 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
3544 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3547 __pyx_t_1 = __pyx_t_3;
3548 goto __pyx_L4_bool_binop_done;
3550 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3551 __pyx_t_1 = __pyx_t_3;
3552 __pyx_L4_bool_binop_done:;
3562 __Pyx_TraceLine(120,0,__PYX_ERR(0, 120, __pyx_L1_error))
3563 __pyx_r = __pyx_v_self->Aop_float->get_num_columns();
3582 __Pyx_TraceLine(121,0,__PYX_ERR(0, 121, __pyx_L1_error))
3583 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
3584 __Pyx_GOTREF(__pyx_t_2);
3585 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
3586 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3589 __pyx_t_1 = __pyx_t_3;
3590 goto __pyx_L6_bool_binop_done;
3592 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3593 __pyx_t_1 = __pyx_t_3;
3594 __pyx_L6_bool_binop_done:;
3604 __Pyx_TraceLine(122,0,__PYX_ERR(0, 122, __pyx_L1_error))
3605 __pyx_r = __pyx_v_self->Aop_double->get_num_columns();
3624 __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
3625 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
3626 __Pyx_GOTREF(__pyx_t_2);
3627 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
3628 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3631 __pyx_t_1 = __pyx_t_3;
3632 goto __pyx_L8_bool_binop_done;
3642 __Pyx_TraceLine(124,0,__PYX_ERR(0, 124, __pyx_L1_error))
3643 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3644 __pyx_t_1 = __pyx_t_3;
3645 __pyx_L8_bool_binop_done:;
3654 __Pyx_TraceLine(123,0,__PYX_ERR(0, 123, __pyx_L1_error))
3655 if (likely(__pyx_t_1)) {
3664 __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
3665 __pyx_r = __pyx_v_self->Aop_long_double->get_num_columns();
3684 __Pyx_TraceLine(127,0,__PYX_ERR(0, 127, __pyx_L1_error))
3686 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
3687 __Pyx_GOTREF(__pyx_t_2);
3688 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3690 __PYX_ERR(0, 127, __pyx_L1_error)
3703 __Pyx_XDECREF(__pyx_t_2);
3704 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
3707 __Pyx_TraceReturn(Py_None, 0);
3708 __Pyx_RefNannyFinishContext();
3721 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3722 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters[] =
"pycLinearOperator.get_num_parameters(self)\n\n :return: Number of parameters.\n :rtype: IndexType\n ";
3723 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters = {
"get_num_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters};
3724 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3725 PyObject *__pyx_r = 0;
3726 __Pyx_RefNannyDeclarations
3727 __Pyx_RefNannySetupContext(
"get_num_parameters (wrapper)", 0);
3728 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
3731 __Pyx_RefNannyFinishContext();
3735 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3736 PyObject *__pyx_r = NULL;
3737 __Pyx_TraceDeclarations
3738 __Pyx_RefNannyDeclarations
3740 PyObject *__pyx_t_2 = NULL;
3742 int __pyx_lineno = 0;
3743 const char *__pyx_filename = NULL;
3744 int __pyx_clineno = 0;
3745 __Pyx_TraceFrameInit(__pyx_codeobj__3)
3746 __Pyx_RefNannySetupContext(
"get_num_parameters", 0);
3747 __Pyx_TraceCall(
"get_num_parameters", __pyx_f[0], 133, 0, __PYX_ERR(0, 133, __pyx_L1_error));
3756 __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3757 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
3758 __Pyx_GOTREF(__pyx_t_2);
3759 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
3760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3763 __pyx_t_1 = __pyx_t_3;
3764 goto __pyx_L4_bool_binop_done;
3766 __pyx_t_3 = ((__pyx_v_self->Aop_float != NULL) != 0);
3767 __pyx_t_1 = __pyx_t_3;
3768 __pyx_L4_bool_binop_done:;
3778 __Pyx_TraceLine(140,0,__PYX_ERR(0, 140, __pyx_L1_error))
3779 __Pyx_XDECREF(__pyx_r);
3780 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_float->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
3781 __Pyx_GOTREF(__pyx_t_2);
3782 __pyx_r = __pyx_t_2;
3802 __Pyx_TraceLine(141,0,__PYX_ERR(0, 141, __pyx_L1_error))
3803 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
3804 __Pyx_GOTREF(__pyx_t_2);
3805 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
3806 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3809 __pyx_t_1 = __pyx_t_3;
3810 goto __pyx_L6_bool_binop_done;
3812 __pyx_t_3 = ((__pyx_v_self->Aop_double != NULL) != 0);
3813 __pyx_t_1 = __pyx_t_3;
3814 __pyx_L6_bool_binop_done:;
3824 __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3825 __Pyx_XDECREF(__pyx_r);
3826 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_double->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
3827 __Pyx_GOTREF(__pyx_t_2);
3828 __pyx_r = __pyx_t_2;
3848 __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
3849 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
3850 __Pyx_GOTREF(__pyx_t_2);
3851 __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
3852 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3855 __pyx_t_1 = __pyx_t_3;
3856 goto __pyx_L8_bool_binop_done;
3866 __Pyx_TraceLine(144,0,__PYX_ERR(0, 144, __pyx_L1_error))
3867 __pyx_t_3 = ((__pyx_v_self->Aop_long_double != NULL) != 0);
3868 __pyx_t_1 = __pyx_t_3;
3869 __pyx_L8_bool_binop_done:;
3878 __Pyx_TraceLine(143,0,__PYX_ERR(0, 143, __pyx_L1_error))
3879 if (likely(__pyx_t_1)) {
3888 __Pyx_TraceLine(145,0,__PYX_ERR(0, 145, __pyx_L1_error))
3889 __Pyx_XDECREF(__pyx_r);
3890 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Aop_long_double->get_num_parameters());
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
3891 __Pyx_GOTREF(__pyx_t_2);
3892 __pyx_r = __pyx_t_2;
3912 __Pyx_TraceLine(147,0,__PYX_ERR(0, 147, __pyx_L1_error))
3914 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
3915 __Pyx_GOTREF(__pyx_t_2);
3916 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3918 __PYX_ERR(0, 147, __pyx_L1_error)
3931 __Pyx_XDECREF(__pyx_t_2);
3932 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_num_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
3935 __Pyx_XGIVEREF(__pyx_r);
3936 __Pyx_TraceReturn(__pyx_r, 0);
3937 __Pyx_RefNannyFinishContext();
3950 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3951 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name[] =
"pycLinearOperator.get_data_type_name(self)\n\n ";
3952 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name = {
"get_data_type_name", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name};
3953 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3954 PyObject *__pyx_r = 0;
3955 __Pyx_RefNannyDeclarations
3956 __Pyx_RefNannySetupContext(
"get_data_type_name (wrapper)", 0);
3957 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
3960 __Pyx_RefNannyFinishContext();
3964 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
3965 PyObject *__pyx_r = NULL;
3966 __Pyx_TraceDeclarations
3967 __Pyx_RefNannyDeclarations
3969 PyObject *__pyx_t_2 = NULL;
3970 int __pyx_lineno = 0;
3971 const char *__pyx_filename = NULL;
3972 int __pyx_clineno = 0;
3973 __Pyx_TraceFrameInit(__pyx_codeobj__4)
3974 __Pyx_RefNannySetupContext(
"get_data_type_name", 0);
3975 __Pyx_TraceCall(
"get_data_type_name", __pyx_f[0], 153, 0, __PYX_ERR(0, 153, __pyx_L1_error));
3984 __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3985 __pyx_t_1 = ((__pyx_v_self->data_type_name == NULL) != 0);
3986 if (unlikely(__pyx_t_1)) {
3995 __Pyx_TraceLine(158,0,__PYX_ERR(0, 158, __pyx_L1_error))
3996 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
3997 __Pyx_GOTREF(__pyx_t_2);
3998 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4000 __PYX_ERR(0, 158, __pyx_L1_error)
4018 __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
4019 __Pyx_XDECREF(__pyx_r);
4020 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
4021 __Pyx_GOTREF(__pyx_t_2);
4022 __pyx_r = __pyx_t_2;
4036 __Pyx_XDECREF(__pyx_t_2);
4037 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_data_type_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
4040 __Pyx_XGIVEREF(__pyx_r);
4041 __Pyx_TraceReturn(__pyx_r, 0);
4042 __Pyx_RefNannyFinishContext();
4054 static cLinearOperator<float> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4056 __Pyx_TraceDeclarations
4057 __Pyx_RefNannyDeclarations
4059 PyObject *__pyx_t_2 = NULL;
4060 PyObject *__pyx_t_3 = NULL;
4061 int __pyx_lineno = 0;
4062 const char *__pyx_filename = NULL;
4063 int __pyx_clineno = 0;
4064 __Pyx_RefNannySetupContext(
"get_linear_operator_float", 0);
4065 __Pyx_TraceCall(
"get_linear_operator_float", __pyx_f[0], 166, 0, __PYX_ERR(0, 166, __pyx_L1_error));
4074 __Pyx_TraceLine(170,0,__PYX_ERR(0, 170, __pyx_L1_error))
4075 __pyx_t_1 = ((__pyx_v_self->Aop_float == NULL) != 0);
4076 if (unlikely(__pyx_t_1)) {
4085 __Pyx_TraceLine(171,0,__PYX_ERR(0, 171, __pyx_L1_error))
4086 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
4087 __Pyx_GOTREF(__pyx_t_2);
4088 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4090 __PYX_ERR(0, 171, __pyx_L1_error)
4108 __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
4109 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
4110 __Pyx_GOTREF(__pyx_t_2);
4111 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float32, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
4112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4113 if (unlikely(__pyx_t_1)) {
4122 __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
4123 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
4124 __Pyx_GOTREF(__pyx_t_2);
4125 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
4126 __Pyx_GOTREF(__pyx_t_3);
4127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4136 __Pyx_TraceLine(174,0,__PYX_ERR(0, 174, __pyx_L1_error))
4137 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
4138 __Pyx_GOTREF(__pyx_t_2);
4139 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4140 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
4141 __Pyx_GOTREF(__pyx_t_3);
4142 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4143 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4144 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4145 __PYX_ERR(0, 174, __pyx_L1_error)
4163 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
4164 __pyx_r = __pyx_v_self->Aop_float;
4177 __Pyx_XDECREF(__pyx_t_2);
4178 __Pyx_XDECREF(__pyx_t_3);
4179 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4182 __Pyx_TraceReturn(Py_None, 0);
4183 __Pyx_RefNannyFinishContext();
4195 static cLinearOperator<double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4197 __Pyx_TraceDeclarations
4198 __Pyx_RefNannyDeclarations
4200 PyObject *__pyx_t_2 = NULL;
4201 PyObject *__pyx_t_3 = NULL;
4202 int __pyx_lineno = 0;
4203 const char *__pyx_filename = NULL;
4204 int __pyx_clineno = 0;
4205 __Pyx_RefNannySetupContext(
"get_linear_operator_double", 0);
4206 __Pyx_TraceCall(
"get_linear_operator_double", __pyx_f[0], 184, 0, __PYX_ERR(0, 184, __pyx_L1_error));
4215 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
4216 __pyx_t_1 = ((__pyx_v_self->Aop_double == NULL) != 0);
4217 if (unlikely(__pyx_t_1)) {
4226 __Pyx_TraceLine(189,0,__PYX_ERR(0, 189, __pyx_L1_error))
4227 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
4228 __Pyx_GOTREF(__pyx_t_2);
4229 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4230 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4231 __PYX_ERR(0, 189, __pyx_L1_error)
4249 __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
4250 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
4251 __Pyx_GOTREF(__pyx_t_2);
4252 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float64, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
4253 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4254 if (unlikely(__pyx_t_1)) {
4263 __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
4264 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
4265 __Pyx_GOTREF(__pyx_t_2);
4266 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
4267 __Pyx_GOTREF(__pyx_t_3);
4268 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4277 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
4278 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
4279 __Pyx_GOTREF(__pyx_t_2);
4280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4281 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
4282 __Pyx_GOTREF(__pyx_t_3);
4283 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4284 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4285 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4286 __PYX_ERR(0, 192, __pyx_L1_error)
4304 __Pyx_TraceLine(196,0,__PYX_ERR(0, 196, __pyx_L1_error))
4305 __pyx_r = __pyx_v_self->Aop_double;
4318 __Pyx_XDECREF(__pyx_t_2);
4319 __Pyx_XDECREF(__pyx_t_3);
4320 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4323 __Pyx_TraceReturn(Py_None, 0);
4324 __Pyx_RefNannyFinishContext();
4336 static cLinearOperator<long double> *__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
4338 __Pyx_TraceDeclarations
4339 __Pyx_RefNannyDeclarations
4341 PyObject *__pyx_t_2 = NULL;
4342 PyObject *__pyx_t_3 = NULL;
4343 int __pyx_lineno = 0;
4344 const char *__pyx_filename = NULL;
4345 int __pyx_clineno = 0;
4346 __Pyx_RefNannySetupContext(
"get_linear_operator_long_double", 0);
4347 __Pyx_TraceCall(
"get_linear_operator_long_double", __pyx_f[0], 202, 0, __PYX_ERR(0, 202, __pyx_L1_error));
4356 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
4357 __pyx_t_1 = ((__pyx_v_self->Aop_long_double == NULL) != 0);
4358 if (unlikely(__pyx_t_1)) {
4367 __Pyx_TraceLine(208,0,__PYX_ERR(0, 208, __pyx_L1_error))
4368 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
4369 __Pyx_GOTREF(__pyx_t_2);
4370 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4371 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4372 __PYX_ERR(0, 208, __pyx_L1_error)
4390 __Pyx_TraceLine(211,0,__PYX_ERR(0, 211, __pyx_L1_error))
4391 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
4392 __Pyx_GOTREF(__pyx_t_2);
4393 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_2, __pyx_n_b_float128, Py_NE));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
4394 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4395 if (unlikely(__pyx_t_1)) {
4404 __Pyx_TraceLine(214,0,__PYX_ERR(0, 214, __pyx_L1_error))
4405 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->data_type_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
4406 __Pyx_GOTREF(__pyx_t_2);
4407 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_LinearOperator_object_is_s, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
4408 __Pyx_GOTREF(__pyx_t_3);
4409 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4418 __Pyx_TraceLine(212,0,__PYX_ERR(0, 212, __pyx_L1_error))
4419 __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
4420 __Pyx_GOTREF(__pyx_t_2);
4421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4422 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
4423 __Pyx_GOTREF(__pyx_t_3);
4424 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4425 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4426 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4427 __PYX_ERR(0, 212, __pyx_L1_error)
4445 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
4446 __pyx_r = __pyx_v_self->Aop_long_double;
4459 __Pyx_XDECREF(__pyx_t_2);
4460 __Pyx_XDECREF(__pyx_t_3);
4461 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.get_linear_operator_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4464 __Pyx_TraceReturn(Py_None, 0);
4465 __Pyx_RefNannyFinishContext();
4478 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters_);
4479 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters[] =
"pycLinearOperator.set_parameters(self, parameters_)\n\n This function is only used for the test unit of this class. For the\n actual computations, the parameters are set though ``cLinearOperator``\n object directly, but not by this function.\n ";
4480 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters = {
"set_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters};
4481 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters_) {
4482 PyObject *__pyx_r = 0;
4483 __Pyx_RefNannyDeclarations
4484 __Pyx_RefNannySetupContext(
"set_parameters (wrapper)", 0);
4485 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), ((PyObject *)__pyx_v_parameters_));
4488 __Pyx_RefNannyFinishContext();
4492 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_parameters_) {
4493 PyObject *__pyx_r = NULL;
4494 __Pyx_TraceDeclarations
4495 __Pyx_RefNannyDeclarations
4496 PyObject *__pyx_t_1 = NULL;
4497 PyObject *__pyx_t_2 = NULL;
4498 PyObject *__pyx_t_3 = NULL;
4500 PyObject *__pyx_t_5 = NULL;
4501 int __pyx_lineno = 0;
4502 const char *__pyx_filename = NULL;
4503 int __pyx_clineno = 0;
4504 __Pyx_TraceFrameInit(__pyx_codeobj__9)
4505 __Pyx_RefNannySetupContext(
"set_parameters", 0);
4506 __Pyx_TraceCall(
"set_parameters", __pyx_f[0], 222, 0, __PYX_ERR(0, 222, __pyx_L1_error));
4515 __Pyx_TraceLine(229,0,__PYX_ERR(0, 229, __pyx_L1_error))
4516 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
4517 __Pyx_GOTREF(__pyx_t_2);
4518 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isscalar);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
4519 __Pyx_GOTREF(__pyx_t_3);
4520 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4522 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4523 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4524 if (likely(__pyx_t_2)) {
4525 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4526 __Pyx_INCREF(__pyx_t_2);
4527 __Pyx_INCREF(
function);
4528 __Pyx_DECREF_SET(__pyx_t_3,
function);
4531 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_parameters_) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_parameters_);
4532 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4533 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
4534 __Pyx_GOTREF(__pyx_t_1);
4535 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4536 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
4537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4547 __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4548 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4549 __Pyx_GOTREF(__pyx_t_1);
4550 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
4551 __Pyx_GOTREF(__pyx_t_3);
4552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4553 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4554 __Pyx_GOTREF(__pyx_t_1);
4555 __Pyx_INCREF(__pyx_v_parameters_);
4556 __Pyx_GIVEREF(__pyx_v_parameters_);
4557 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_parameters_);
4558 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4559 __Pyx_GOTREF(__pyx_t_2);
4560 __Pyx_GIVEREF(__pyx_t_1);
4561 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4563 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4564 __Pyx_GOTREF(__pyx_t_1);
4565 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
4566 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error)
4567 __Pyx_GOTREF(__pyx_t_5);
4568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4571 __Pyx_GIVEREF(__pyx_t_5);
4572 __Pyx_GOTREF(__pyx_v_self->parameters);
4573 __Pyx_DECREF(__pyx_v_self->parameters);
4574 __pyx_v_self->parameters = __pyx_t_5;
4594 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4596 __Pyx_INCREF(__pyx_v_parameters_);
4597 __Pyx_GIVEREF(__pyx_v_parameters_);
4598 __Pyx_GOTREF(__pyx_v_self->parameters);
4599 __Pyx_DECREF(__pyx_v_self->parameters);
4600 __pyx_v_self->parameters = __pyx_v_parameters_;
4613 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4616 __Pyx_XDECREF(__pyx_t_1);
4617 __Pyx_XDECREF(__pyx_t_2);
4618 __Pyx_XDECREF(__pyx_t_3);
4619 __Pyx_XDECREF(__pyx_t_5);
4620 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.set_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
4623 __Pyx_XGIVEREF(__pyx_r);
4624 __Pyx_TraceReturn(__pyx_r, 0);
4625 __Pyx_RefNannyFinishContext();
4637 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4638 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch) {
4639 __Pyx_memviewslice __pyx_v_mv_vector_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4640 __Pyx_memviewslice __pyx_v_mv_vector_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4641 __Pyx_memviewslice __pyx_v_mv_vector_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4642 __Pyx_memviewslice __pyx_v_mv_product_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4643 __Pyx_memviewslice __pyx_v_mv_product_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4644 __Pyx_memviewslice __pyx_v_mv_product_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4645 __Pyx_memviewslice __pyx_v_mv_parameters_float = { 0, 0, { 0 }, { 0 }, { 0 } };
4646 __Pyx_memviewslice __pyx_v_mv_parameters_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4647 __Pyx_memviewslice __pyx_v_mv_parameters_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
4648 float *__pyx_v_c_vector_float;
4649 double *__pyx_v_c_vector_double;
4650 long double *__pyx_v_c_vector_long_double;
4651 float *__pyx_v_c_product_float;
4652 double *__pyx_v_c_product_double;
4653 long double *__pyx_v_c_product_long_double;
4654 float *__pyx_v_c_parameters_float;
4655 double *__pyx_v_c_parameters_double;
4656 long double *__pyx_v_c_parameters_long_double;
4657 __Pyx_TraceDeclarations
4658 __Pyx_RefNannyDeclarations
4659 PyObject *__pyx_t_1 = NULL;
4660 PyObject *__pyx_t_2 = NULL;
4661 PyObject *__pyx_t_3 = NULL;
4662 PyObject *__pyx_t_4 = NULL;
4664 PyObject *__pyx_t_6 = NULL;
4666 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4667 Py_ssize_t __pyx_t_9;
4669 __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
4670 __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
4671 int __pyx_lineno = 0;
4672 const char *__pyx_filename = NULL;
4673 int __pyx_clineno = 0;
4674 __Pyx_TraceFrameInit(__pyx_codeobj__10)
4675 __Pyx_RefNannySetupContext(
"dot", 0);
4676 __Pyx_TraceCall(
"dot", __pyx_f[0], 238, 0, __PYX_ERR(0, 238, __pyx_L1_error));
4678 if (unlikely(__pyx_skip_dispatch)) ;
4680 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4681 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4682 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4683 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4684 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4686 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
4687 __Pyx_GOTREF(__pyx_t_1);
4688 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot)) {
4689 __Pyx_INCREF(__pyx_t_1);
4690 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4692 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4693 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4694 if (likely(__pyx_t_4)) {
4695 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4696 __Pyx_INCREF(__pyx_t_4);
4697 __Pyx_INCREF(
function);
4698 __Pyx_DECREF_SET(__pyx_t_3,
function);
4702 #if CYTHON_FAST_PYCALL
4703 if (PyFunction_Check(__pyx_t_3)) {
4704 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
4705 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4706 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4707 __Pyx_GOTREF(__pyx_t_2);
4710 #if CYTHON_FAST_PYCCALL
4711 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4712 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
4713 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4714 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4715 __Pyx_GOTREF(__pyx_t_2);
4719 __pyx_t_6 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
4720 __Pyx_GOTREF(__pyx_t_6);
4722 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
4724 __Pyx_INCREF(__pyx_v_vector);
4725 __Pyx_GIVEREF(__pyx_v_vector);
4726 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_vector);
4727 __Pyx_INCREF(__pyx_v_product);
4728 __Pyx_GIVEREF(__pyx_v_product);
4729 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_product);
4730 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
4731 __Pyx_GOTREF(__pyx_t_2);
4732 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4739 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4740 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4741 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4742 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4743 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4747 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4759 __Pyx_TraceLine(242,0,__PYX_ERR(0, 242, __pyx_L1_error))
4760 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
4761 __Pyx_GOTREF(__pyx_t_1);
4762 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_product, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
4763 __Pyx_GOTREF(__pyx_t_2);
4764 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
4765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4767 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 242, __pyx_L1_error)
4768 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4769 if (unlikely(__pyx_t_7)) {
4778 __Pyx_TraceLine(243,0,__PYX_ERR(0, 243, __pyx_L1_error))
4779 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
4780 __Pyx_GOTREF(__pyx_t_3);
4781 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4783 __PYX_ERR(0, 243, __pyx_L1_error)
4801 __Pyx_TraceLine(276,0,__PYX_ERR(0, 276, __pyx_L1_error))
4802 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
4803 __Pyx_GOTREF(__pyx_t_3);
4804 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float32, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
4805 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4815 __Pyx_TraceLine(279,0,__PYX_ERR(0, 279, __pyx_L1_error))
4816 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 279, __pyx_L1_error)
4817 __pyx_v_mv_vector_float = __pyx_t_8;
4818 __pyx_t_8.memview = NULL;
4819 __pyx_t_8.data = NULL;
4828 __Pyx_TraceLine(280,0,__PYX_ERR(0, 280, __pyx_L1_error))
4830 __pyx_v_c_vector_float = (&(*((
float *) ( (__pyx_v_mv_vector_float.data + __pyx_t_9 * __pyx_v_mv_vector_float.strides[0]) ))));
4839 __Pyx_TraceLine(283,0,__PYX_ERR(0, 283, __pyx_L1_error))
4840 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 283, __pyx_L1_error)
4841 __pyx_v_mv_product_float = __pyx_t_8;
4842 __pyx_t_8.memview = NULL;
4843 __pyx_t_8.data = NULL;
4852 __Pyx_TraceLine(284,0,__PYX_ERR(0, 284, __pyx_L1_error))
4854 __pyx_v_c_product_float = (&(*((
float *) ( (__pyx_v_mv_product_float.data + __pyx_t_9 * __pyx_v_mv_product_float.strides[0]) ))));
4863 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4864 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
4865 __pyx_t_10 = (__pyx_t_7 != 0);
4875 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4876 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4877 __Pyx_GOTREF(__pyx_t_2);
4879 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4880 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
4881 if (likely(__pyx_t_1)) {
4882 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4883 __Pyx_INCREF(__pyx_t_1);
4884 __Pyx_INCREF(
function);
4885 __Pyx_DECREF_SET(__pyx_t_2,
function);
4888 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float32) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float32);
4889 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4890 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
4891 __Pyx_GOTREF(__pyx_t_3);
4892 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4893 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 288, __pyx_L1_error)
4894 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4895 __pyx_v_mv_parameters_float = __pyx_t_8;
4896 __pyx_t_8.memview = NULL;
4897 __pyx_t_8.data = NULL;
4906 __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4908 __pyx_v_c_parameters_float = (&(*((
float *) ( (__pyx_v_mv_parameters_float.data + __pyx_t_9 * __pyx_v_mv_parameters_float.strides[0]) ))));
4917 __Pyx_TraceLine(290,0,__PYX_ERR(0, 290, __pyx_L1_error))
4918 __pyx_v_self->Aop_float->set_parameters(__pyx_v_c_parameters_float);
4936 __Pyx_TraceLine(293,0,__PYX_ERR(0, 293, __pyx_L1_error))
4937 __pyx_v_self->Aop_float->dot(__pyx_v_c_vector_float, __pyx_v_c_product_float);
4956 __Pyx_TraceLine(295,0,__PYX_ERR(0, 295, __pyx_L1_error))
4957 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
4958 __Pyx_GOTREF(__pyx_t_3);
4959 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float64, Py_EQ));
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
4960 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4970 __Pyx_TraceLine(298,0,__PYX_ERR(0, 298, __pyx_L1_error))
4971 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 298, __pyx_L1_error)
4972 __pyx_v_mv_vector_double = __pyx_t_11;
4973 __pyx_t_11.memview = NULL;
4974 __pyx_t_11.data = NULL;
4983 __Pyx_TraceLine(299,0,__PYX_ERR(0, 299, __pyx_L1_error))
4985 __pyx_v_c_vector_double = (&(*((
double *) ( (__pyx_v_mv_vector_double.data + __pyx_t_9 * __pyx_v_mv_vector_double.strides[0]) ))));
4994 __Pyx_TraceLine(302,0,__PYX_ERR(0, 302, __pyx_L1_error))
4995 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 302, __pyx_L1_error)
4996 __pyx_v_mv_product_double = __pyx_t_11;
4997 __pyx_t_11.memview = NULL;
4998 __pyx_t_11.data = NULL;
5007 __Pyx_TraceLine(303,0,__PYX_ERR(0, 303, __pyx_L1_error))
5009 __pyx_v_c_product_double = (&(*((
double *) ( (__pyx_v_mv_product_double.data + __pyx_t_9 * __pyx_v_mv_product_double.strides[0]) ))));
5018 __Pyx_TraceLine(306,0,__PYX_ERR(0, 306, __pyx_L1_error))
5019 __pyx_t_10 = (__pyx_v_self->parameters != Py_None);
5020 __pyx_t_7 = (__pyx_t_10 != 0);
5030 __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
5031 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
5032 __Pyx_GOTREF(__pyx_t_2);
5034 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5035 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5036 if (likely(__pyx_t_1)) {
5037 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5038 __Pyx_INCREF(__pyx_t_1);
5039 __Pyx_INCREF(
function);
5040 __Pyx_DECREF_SET(__pyx_t_2,
function);
5043 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float64) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float64);
5044 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5045 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_3);
5047 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5048 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 307, __pyx_L1_error)
5049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5050 __pyx_v_mv_parameters_double = __pyx_t_11;
5051 __pyx_t_11.memview = NULL;
5052 __pyx_t_11.data = NULL;
5061 __Pyx_TraceLine(308,0,__PYX_ERR(0, 308, __pyx_L1_error))
5063 __pyx_v_c_parameters_double = (&(*((
double *) ( (__pyx_v_mv_parameters_double.data + __pyx_t_9 * __pyx_v_mv_parameters_double.strides[0]) ))));
5072 __Pyx_TraceLine(309,0,__PYX_ERR(0, 309, __pyx_L1_error))
5073 __pyx_v_self->Aop_double->set_parameters(__pyx_v_c_parameters_double);
5091 __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
5092 __pyx_v_self->Aop_double->dot(__pyx_v_c_vector_double, __pyx_v_c_product_double);
5111 __Pyx_TraceLine(314,0,__PYX_ERR(0, 314, __pyx_L1_error))
5112 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
5113 __Pyx_GOTREF(__pyx_t_3);
5114 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float128, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
5115 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5116 if (likely(__pyx_t_7)) {
5125 __Pyx_TraceLine(317,0,__PYX_ERR(0, 317, __pyx_L1_error))
5126 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 317, __pyx_L1_error)
5127 __pyx_v_mv_vector_long_double = __pyx_t_12;
5128 __pyx_t_12.memview = NULL;
5129 __pyx_t_12.data = NULL;
5138 __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
5140 __pyx_v_c_vector_long_double = (&(*((
long double *) ( (__pyx_v_mv_vector_long_double.data + __pyx_t_9 * __pyx_v_mv_vector_long_double.strides[0]) ))));
5149 __Pyx_TraceLine(321,0,__PYX_ERR(0, 321, __pyx_L1_error))
5150 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 321, __pyx_L1_error)
5151 __pyx_v_mv_product_long_double = __pyx_t_12;
5152 __pyx_t_12.memview = NULL;
5153 __pyx_t_12.data = NULL;
5162 __Pyx_TraceLine(322,0,__PYX_ERR(0, 322, __pyx_L1_error))
5164 __pyx_v_c_product_long_double = (&(*((
long double *) ( (__pyx_v_mv_product_long_double.data + __pyx_t_9 * __pyx_v_mv_product_long_double.strides[0]) ))));
5173 __Pyx_TraceLine(325,0,__PYX_ERR(0, 325, __pyx_L1_error))
5174 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
5175 __pyx_t_10 = (__pyx_t_7 != 0);
5185 __Pyx_TraceLine(326,0,__PYX_ERR(0, 326, __pyx_L1_error))
5186 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
5187 __Pyx_GOTREF(__pyx_t_2);
5189 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5190 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5191 if (likely(__pyx_t_1)) {
5192 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5193 __Pyx_INCREF(__pyx_t_1);
5194 __Pyx_INCREF(
function);
5195 __Pyx_DECREF_SET(__pyx_t_2,
function);
5198 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float128) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float128);
5199 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5200 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_3);
5202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5203 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 326, __pyx_L1_error)
5204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5205 __pyx_v_mv_parameters_long_double = __pyx_t_12;
5206 __pyx_t_12.memview = NULL;
5207 __pyx_t_12.data = NULL;
5216 __Pyx_TraceLine(327,0,__PYX_ERR(0, 327, __pyx_L1_error))
5218 __pyx_v_c_parameters_long_double = (&(*((
long double *) ( (__pyx_v_mv_parameters_long_double.data + __pyx_t_9 * __pyx_v_mv_parameters_long_double.strides[0]) ))));
5227 __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
5228 __pyx_v_self->Aop_long_double->set_parameters(__pyx_v_c_parameters_long_double);
5246 __Pyx_TraceLine(331,0,__PYX_ERR(0, 331, __pyx_L1_error))
5247 __pyx_v_self->Aop_long_double->dot(__pyx_v_c_vector_long_double, __pyx_v_c_product_long_double);
5266 __Pyx_TraceLine(335,0,__PYX_ERR(0, 335, __pyx_L1_error))
5268 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error)
5269 __Pyx_GOTREF(__pyx_t_3);
5270 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5272 __PYX_ERR(0, 335, __pyx_L1_error)
5287 __Pyx_XDECREF(__pyx_t_1);
5288 __Pyx_XDECREF(__pyx_t_2);
5289 __Pyx_XDECREF(__pyx_t_3);
5290 __Pyx_XDECREF(__pyx_t_4);
5291 __Pyx_XDECREF(__pyx_t_6);
5292 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5293 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
5294 __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
5295 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5297 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_float, 1);
5298 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_double, 1);
5299 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_long_double, 1);
5300 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_float, 1);
5301 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_double, 1);
5302 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_long_double, 1);
5303 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_float, 1);
5304 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_double, 1);
5305 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_long_double, 1);
5306 __Pyx_TraceReturn(Py_None, 0);
5307 __Pyx_RefNannyFinishContext();
5311 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5312 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot[] =
"pycLinearOperator.dot(self, vector, product) -> void\n\n ";
5313 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot = {
"dot", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot};
5314 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5315 PyObject *__pyx_v_vector = 0;
5316 PyObject *__pyx_v_product = 0;
5317 int __pyx_lineno = 0;
5318 const char *__pyx_filename = NULL;
5319 int __pyx_clineno = 0;
5320 PyObject *__pyx_r = 0;
5321 __Pyx_RefNannyDeclarations
5322 __Pyx_RefNannySetupContext(
"dot (wrapper)", 0);
5324 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vector,&__pyx_n_s_product,0};
5325 PyObject* values[2] = {0,0};
5326 if (unlikely(__pyx_kwds)) {
5328 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5330 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5332 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5335 default:
goto __pyx_L5_argtuple_error;
5337 kw_args = PyDict_Size(__pyx_kwds);
5340 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vector)) != 0)) kw_args--;
5341 else goto __pyx_L5_argtuple_error;
5344 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_product)) != 0)) kw_args--;
5346 __Pyx_RaiseArgtupleInvalid(
"dot", 1, 2, 2, 1); __PYX_ERR(0, 238, __pyx_L3_error)
5349 if (unlikely(kw_args > 0)) {
5350 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"dot") < 0)) __PYX_ERR(0, 238, __pyx_L3_error)
5352 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5353 goto __pyx_L5_argtuple_error;
5355 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5356 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5358 __pyx_v_vector = values[0];
5359 __pyx_v_product = values[1];
5361 goto __pyx_L4_argument_unpacking_done;
5362 __pyx_L5_argtuple_error:;
5363 __Pyx_RaiseArgtupleInvalid(
"dot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 238, __pyx_L3_error)
5365 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5366 __Pyx_RefNannyFinishContext();
5368 __pyx_L4_argument_unpacking_done:;
5369 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), __pyx_v_vector, __pyx_v_product);
5372 __Pyx_RefNannyFinishContext();
5376 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_10dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product) {
5377 PyObject *__pyx_r = NULL;
5378 __Pyx_TraceDeclarations
5379 __Pyx_RefNannyDeclarations
5380 PyObject *__pyx_t_1 = NULL;
5381 int __pyx_lineno = 0;
5382 const char *__pyx_filename = NULL;
5383 int __pyx_clineno = 0;
5384 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5385 __Pyx_RefNannySetupContext(
"dot", 0);
5386 __Pyx_TraceCall(
"dot (wrapper)", __pyx_f[0], 238, 0, __PYX_ERR(0, 238, __pyx_L1_error));
5387 __Pyx_XDECREF(__pyx_r);
5388 __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot(__pyx_v_self, __pyx_v_vector, __pyx_v_product, 1);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 238, __pyx_L1_error)
5389 __pyx_t_1 = __Pyx_void_to_None(NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
5390 __Pyx_GOTREF(__pyx_t_1);
5391 __pyx_r = __pyx_t_1;
5397 __Pyx_XDECREF(__pyx_t_1);
5398 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
5401 __Pyx_XGIVEREF(__pyx_r);
5402 __Pyx_TraceReturn(__pyx_r, 0);
5403 __Pyx_RefNannyFinishContext();
5415 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5416 static void __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product,
int __pyx_skip_dispatch) {
5417 __Pyx_memviewslice __pyx_v_mv_vector_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5418 __Pyx_memviewslice __pyx_v_mv_vector_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5419 __Pyx_memviewslice __pyx_v_mv_vector_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5420 __Pyx_memviewslice __pyx_v_mv_product_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5421 __Pyx_memviewslice __pyx_v_mv_product_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5422 __Pyx_memviewslice __pyx_v_mv_product_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5423 __Pyx_memviewslice __pyx_v_mv_parameters_float = { 0, 0, { 0 }, { 0 }, { 0 } };
5424 __Pyx_memviewslice __pyx_v_mv_parameters_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5425 __Pyx_memviewslice __pyx_v_mv_parameters_long_double = { 0, 0, { 0 }, { 0 }, { 0 } };
5426 float *__pyx_v_c_vector_float;
5427 double *__pyx_v_c_vector_double;
5428 long double *__pyx_v_c_vector_long_double;
5429 float *__pyx_v_c_product_float;
5430 double *__pyx_v_c_product_double;
5431 long double *__pyx_v_c_product_long_double;
5432 float *__pyx_v_c_parameters_float;
5433 double *__pyx_v_c_parameters_double;
5434 long double *__pyx_v_c_parameters_long_double;
5435 __Pyx_TraceDeclarations
5436 __Pyx_RefNannyDeclarations
5437 PyObject *__pyx_t_1 = NULL;
5438 PyObject *__pyx_t_2 = NULL;
5439 PyObject *__pyx_t_3 = NULL;
5440 PyObject *__pyx_t_4 = NULL;
5442 PyObject *__pyx_t_6 = NULL;
5444 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5445 Py_ssize_t __pyx_t_9;
5447 __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
5448 __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
5449 int __pyx_lineno = 0;
5450 const char *__pyx_filename = NULL;
5451 int __pyx_clineno = 0;
5452 __Pyx_TraceFrameInit(__pyx_codeobj__13)
5453 __Pyx_RefNannySetupContext(
"transpose_dot", 0);
5454 __Pyx_TraceCall(
"transpose_dot", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
5456 if (unlikely(__pyx_skip_dispatch)) ;
5458 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5459 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5460 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5461 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5462 PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5464 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_transpose_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
5465 __Pyx_GOTREF(__pyx_t_1);
5466 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(
void*)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot)) {
5467 __Pyx_INCREF(__pyx_t_1);
5468 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
5470 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5471 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5472 if (likely(__pyx_t_4)) {
5473 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
5474 __Pyx_INCREF(__pyx_t_4);
5475 __Pyx_INCREF(
function);
5476 __Pyx_DECREF_SET(__pyx_t_3,
function);
5480 #if CYTHON_FAST_PYCALL
5481 if (PyFunction_Check(__pyx_t_3)) {
5482 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
5483 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5484 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5485 __Pyx_GOTREF(__pyx_t_2);
5488 #if CYTHON_FAST_PYCCALL
5489 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5490 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_v_product};
5491 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5492 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5493 __Pyx_GOTREF(__pyx_t_2);
5497 __pyx_t_6 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
5498 __Pyx_GOTREF(__pyx_t_6);
5500 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
5502 __Pyx_INCREF(__pyx_v_vector);
5503 __Pyx_GIVEREF(__pyx_v_vector);
5504 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_vector);
5505 __Pyx_INCREF(__pyx_v_product);
5506 __Pyx_GIVEREF(__pyx_v_product);
5507 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_product);
5508 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
5509 __Pyx_GOTREF(__pyx_t_2);
5510 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5517 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5518 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5519 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5520 if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5521 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5525 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5537 __Pyx_TraceLine(346,0,__PYX_ERR(0, 346, __pyx_L1_error))
5538 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
5539 __Pyx_GOTREF(__pyx_t_1);
5540 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_product, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
5541 __Pyx_GOTREF(__pyx_t_2);
5542 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
5543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5544 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5545 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
5546 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5547 if (unlikely(__pyx_t_7)) {
5556 __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
5557 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
5558 __Pyx_GOTREF(__pyx_t_3);
5559 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5560 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5561 __PYX_ERR(0, 347, __pyx_L1_error)
5579 __Pyx_TraceLine(380,0,__PYX_ERR(0, 380, __pyx_L1_error))
5580 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
5581 __Pyx_GOTREF(__pyx_t_3);
5582 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float32, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 380, __pyx_L1_error)
5583 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5593 __Pyx_TraceLine(383,0,__PYX_ERR(0, 383, __pyx_L1_error))
5594 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 383, __pyx_L1_error)
5595 __pyx_v_mv_vector_float = __pyx_t_8;
5596 __pyx_t_8.memview = NULL;
5597 __pyx_t_8.data = NULL;
5606 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
5608 __pyx_v_c_vector_float = (&(*((
float *) ( (__pyx_v_mv_vector_float.data + __pyx_t_9 * __pyx_v_mv_vector_float.strides[0]) ))));
5617 __Pyx_TraceLine(387,0,__PYX_ERR(0, 387, __pyx_L1_error))
5618 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 387, __pyx_L1_error)
5619 __pyx_v_mv_product_float = __pyx_t_8;
5620 __pyx_t_8.memview = NULL;
5621 __pyx_t_8.data = NULL;
5630 __Pyx_TraceLine(388,0,__PYX_ERR(0, 388, __pyx_L1_error))
5632 __pyx_v_c_product_float = (&(*((
float *) ( (__pyx_v_mv_product_float.data + __pyx_t_9 * __pyx_v_mv_product_float.strides[0]) ))));
5641 __Pyx_TraceLine(391,0,__PYX_ERR(0, 391, __pyx_L1_error))
5642 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
5643 __pyx_t_10 = (__pyx_t_7 != 0);
5653 __Pyx_TraceLine(392,0,__PYX_ERR(0, 392, __pyx_L1_error))
5654 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
5655 __Pyx_GOTREF(__pyx_t_2);
5657 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5658 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5659 if (likely(__pyx_t_1)) {
5660 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5661 __Pyx_INCREF(__pyx_t_1);
5662 __Pyx_INCREF(
function);
5663 __Pyx_DECREF_SET(__pyx_t_2,
function);
5666 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float32) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float32);
5667 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5668 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
5669 __Pyx_GOTREF(__pyx_t_3);
5670 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5671 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 392, __pyx_L1_error)
5672 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5673 __pyx_v_mv_parameters_float = __pyx_t_8;
5674 __pyx_t_8.memview = NULL;
5675 __pyx_t_8.data = NULL;
5684 __Pyx_TraceLine(393,0,__PYX_ERR(0, 393, __pyx_L1_error))
5686 __pyx_v_c_parameters_float = (&(*((
float *) ( (__pyx_v_mv_parameters_float.data + __pyx_t_9 * __pyx_v_mv_parameters_float.strides[0]) ))));
5695 __Pyx_TraceLine(394,0,__PYX_ERR(0, 394, __pyx_L1_error))
5696 __pyx_v_self->Aop_float->set_parameters(__pyx_v_c_parameters_float);
5714 __Pyx_TraceLine(397,0,__PYX_ERR(0, 397, __pyx_L1_error))
5715 __pyx_v_self->Aop_float->transpose_dot(__pyx_v_c_vector_float, __pyx_v_c_product_float);
5734 __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5735 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
5736 __Pyx_GOTREF(__pyx_t_3);
5737 __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float64, Py_EQ));
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
5738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5748 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5749 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 402, __pyx_L1_error)
5750 __pyx_v_mv_vector_double = __pyx_t_11;
5751 __pyx_t_11.memview = NULL;
5752 __pyx_t_11.data = NULL;
5761 __Pyx_TraceLine(403,0,__PYX_ERR(0, 403, __pyx_L1_error))
5763 __pyx_v_c_vector_double = (&(*((
double *) ( (__pyx_v_mv_vector_double.data + __pyx_t_9 * __pyx_v_mv_vector_double.strides[0]) ))));
5772 __Pyx_TraceLine(406,0,__PYX_ERR(0, 406, __pyx_L1_error))
5773 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 406, __pyx_L1_error)
5774 __pyx_v_mv_product_double = __pyx_t_11;
5775 __pyx_t_11.memview = NULL;
5776 __pyx_t_11.data = NULL;
5785 __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5787 __pyx_v_c_product_double = (&(*((
double *) ( (__pyx_v_mv_product_double.data + __pyx_t_9 * __pyx_v_mv_product_double.strides[0]) ))));
5796 __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5797 __pyx_t_10 = (__pyx_v_self->parameters != Py_None);
5798 __pyx_t_7 = (__pyx_t_10 != 0);
5808 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5809 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
5810 __Pyx_GOTREF(__pyx_t_2);
5812 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5813 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5814 if (likely(__pyx_t_1)) {
5815 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5816 __Pyx_INCREF(__pyx_t_1);
5817 __Pyx_INCREF(
function);
5818 __Pyx_DECREF_SET(__pyx_t_2,
function);
5821 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float64) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float64);
5822 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5823 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
5824 __Pyx_GOTREF(__pyx_t_3);
5825 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5826 __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 411, __pyx_L1_error)
5827 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5828 __pyx_v_mv_parameters_double = __pyx_t_11;
5829 __pyx_t_11.memview = NULL;
5830 __pyx_t_11.data = NULL;
5839 __Pyx_TraceLine(412,0,__PYX_ERR(0, 412, __pyx_L1_error))
5841 __pyx_v_c_parameters_double = (&(*((
double *) ( (__pyx_v_mv_parameters_double.data + __pyx_t_9 * __pyx_v_mv_parameters_double.strides[0]) ))));
5850 __Pyx_TraceLine(413,0,__PYX_ERR(0, 413, __pyx_L1_error))
5851 __pyx_v_self->Aop_double->set_parameters(__pyx_v_c_parameters_double);
5869 __Pyx_TraceLine(416,0,__PYX_ERR(0, 416, __pyx_L1_error))
5870 __pyx_v_self->Aop_double->transpose_dot(__pyx_v_c_vector_double, __pyx_v_c_product_double);
5889 __Pyx_TraceLine(418,0,__PYX_ERR(0, 418, __pyx_L1_error))
5890 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
5891 __Pyx_GOTREF(__pyx_t_3);
5892 __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_n_u_float128, Py_EQ));
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
5893 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5894 if (likely(__pyx_t_7)) {
5903 __Pyx_TraceLine(421,0,__PYX_ERR(0, 421, __pyx_L1_error))
5904 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_vector, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 421, __pyx_L1_error)
5905 __pyx_v_mv_vector_long_double = __pyx_t_12;
5906 __pyx_t_12.memview = NULL;
5907 __pyx_t_12.data = NULL;
5916 __Pyx_TraceLine(422,0,__PYX_ERR(0, 422, __pyx_L1_error))
5918 __pyx_v_c_vector_long_double = (&(*((
long double *) ( (__pyx_v_mv_vector_long_double.data + __pyx_t_9 * __pyx_v_mv_vector_long_double.strides[0]) ))));
5927 __Pyx_TraceLine(425,0,__PYX_ERR(0, 425, __pyx_L1_error))
5928 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_v_product, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 425, __pyx_L1_error)
5929 __pyx_v_mv_product_long_double = __pyx_t_12;
5930 __pyx_t_12.memview = NULL;
5931 __pyx_t_12.data = NULL;
5940 __Pyx_TraceLine(426,0,__PYX_ERR(0, 426, __pyx_L1_error))
5942 __pyx_v_c_product_long_double = (&(*((
long double *) ( (__pyx_v_mv_product_long_double.data + __pyx_t_9 * __pyx_v_mv_product_long_double.strides[0]) ))));
5951 __Pyx_TraceLine(429,0,__PYX_ERR(0, 429, __pyx_L1_error))
5952 __pyx_t_7 = (__pyx_v_self->parameters != Py_None);
5953 __pyx_t_10 = (__pyx_t_7 != 0);
5963 __Pyx_TraceLine(430,0,__PYX_ERR(0, 430, __pyx_L1_error))
5964 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->parameters, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
5965 __Pyx_GOTREF(__pyx_t_2);
5967 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5968 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
5969 if (likely(__pyx_t_1)) {
5970 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5971 __Pyx_INCREF(__pyx_t_1);
5972 __Pyx_INCREF(
function);
5973 __Pyx_DECREF_SET(__pyx_t_2,
function);
5976 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_n_u_float128) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_u_float128);
5977 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5978 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
5979 __Pyx_GOTREF(__pyx_t_3);
5980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5981 __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_3, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 430, __pyx_L1_error)
5982 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5983 __pyx_v_mv_parameters_long_double = __pyx_t_12;
5984 __pyx_t_12.memview = NULL;
5985 __pyx_t_12.data = NULL;
5994 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
5996 __pyx_v_c_parameters_long_double = (&(*((
long double *) ( (__pyx_v_mv_parameters_long_double.data + __pyx_t_9 * __pyx_v_mv_parameters_long_double.strides[0]) ))));
6005 __Pyx_TraceLine(432,0,__PYX_ERR(0, 432, __pyx_L1_error))
6006 __pyx_v_self->Aop_long_double->set_parameters(__pyx_v_c_parameters_long_double);
6024 __Pyx_TraceLine(435,0,__PYX_ERR(0, 435, __pyx_L1_error))
6025 __pyx_v_self->Aop_long_double->transpose_dot(__pyx_v_c_vector_long_double, __pyx_v_c_product_long_double);
6043 __Pyx_TraceLine(439,0,__PYX_ERR(0, 439, __pyx_L1_error))
6045 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
6046 __Pyx_GOTREF(__pyx_t_3);
6047 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6048 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6049 __PYX_ERR(0, 439, __pyx_L1_error)
6064 __Pyx_XDECREF(__pyx_t_1);
6065 __Pyx_XDECREF(__pyx_t_2);
6066 __Pyx_XDECREF(__pyx_t_3);
6067 __Pyx_XDECREF(__pyx_t_4);
6068 __Pyx_XDECREF(__pyx_t_6);
6069 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6070 __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
6071 __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
6072 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6074 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_float, 1);
6075 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_double, 1);
6076 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_vector_long_double, 1);
6077 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_float, 1);
6078 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_double, 1);
6079 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_product_long_double, 1);
6080 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_float, 1);
6081 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_double, 1);
6082 __PYX_XDEC_MEMVIEW(&__pyx_v_mv_parameters_long_double, 1);
6083 __Pyx_TraceReturn(Py_None, 0);
6084 __Pyx_RefNannyFinishContext();
6088 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6089 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot[] =
"pycLinearOperator.transpose_dot(self, vector, product) -> void\n\n ";
6090 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot = {
"transpose_dot", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot};
6091 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6092 PyObject *__pyx_v_vector = 0;
6093 PyObject *__pyx_v_product = 0;
6094 int __pyx_lineno = 0;
6095 const char *__pyx_filename = NULL;
6096 int __pyx_clineno = 0;
6097 PyObject *__pyx_r = 0;
6098 __Pyx_RefNannyDeclarations
6099 __Pyx_RefNannySetupContext(
"transpose_dot (wrapper)", 0);
6101 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vector,&__pyx_n_s_product,0};
6102 PyObject* values[2] = {0,0};
6103 if (unlikely(__pyx_kwds)) {
6105 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6107 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6109 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6112 default:
goto __pyx_L5_argtuple_error;
6114 kw_args = PyDict_Size(__pyx_kwds);
6117 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vector)) != 0)) kw_args--;
6118 else goto __pyx_L5_argtuple_error;
6121 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_product)) != 0)) kw_args--;
6123 __Pyx_RaiseArgtupleInvalid(
"transpose_dot", 1, 2, 2, 1); __PYX_ERR(0, 342, __pyx_L3_error)
6126 if (unlikely(kw_args > 0)) {
6127 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"transpose_dot") < 0)) __PYX_ERR(0, 342, __pyx_L3_error)
6129 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6130 goto __pyx_L5_argtuple_error;
6132 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6133 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6135 __pyx_v_vector = values[0];
6136 __pyx_v_product = values[1];
6138 goto __pyx_L4_argument_unpacking_done;
6139 __pyx_L5_argtuple_error:;
6140 __Pyx_RaiseArgtupleInvalid(
"transpose_dot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 342, __pyx_L3_error)
6142 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6143 __Pyx_RefNannyFinishContext();
6145 __pyx_L4_argument_unpacking_done:;
6146 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), __pyx_v_vector, __pyx_v_product);
6149 __Pyx_RefNannyFinishContext();
6153 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_12transpose_dot(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, PyObject *__pyx_v_vector, PyObject *__pyx_v_product) {
6154 PyObject *__pyx_r = NULL;
6155 __Pyx_TraceDeclarations
6156 __Pyx_RefNannyDeclarations
6157 PyObject *__pyx_t_1 = NULL;
6158 int __pyx_lineno = 0;
6159 const char *__pyx_filename = NULL;
6160 int __pyx_clineno = 0;
6161 __Pyx_TraceFrameInit(__pyx_codeobj__13)
6162 __Pyx_RefNannySetupContext(
"transpose_dot", 0);
6163 __Pyx_TraceCall(
"transpose_dot (wrapper)", __pyx_f[0], 342, 0, __PYX_ERR(0, 342, __pyx_L1_error));
6164 __Pyx_XDECREF(__pyx_r);
6165 __pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot(__pyx_v_self, __pyx_v_vector, __pyx_v_product, 1);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
6166 __pyx_t_1 = __Pyx_void_to_None(NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
6167 __Pyx_GOTREF(__pyx_t_1);
6168 __pyx_r = __pyx_t_1;
6174 __Pyx_XDECREF(__pyx_t_1);
6175 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.transpose_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6178 __Pyx_XGIVEREF(__pyx_r);
6179 __Pyx_TraceReturn(__pyx_r, 0);
6180 __Pyx_RefNannyFinishContext();
6191 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6192 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__[] =
"pycLinearOperator.__reduce_cython__(self)";
6193 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__};
6194 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6195 PyObject *__pyx_r = 0;
6196 __Pyx_RefNannyDeclarations
6197 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6198 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self));
6201 __Pyx_RefNannyFinishContext();
6205 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self) {
6206 PyObject *__pyx_r = NULL;
6207 __Pyx_TraceDeclarations
6208 __Pyx_RefNannyDeclarations
6209 PyObject *__pyx_t_1 = NULL;
6210 int __pyx_lineno = 0;
6211 const char *__pyx_filename = NULL;
6212 int __pyx_clineno = 0;
6213 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6214 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6215 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6223 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6224 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6225 __Pyx_GOTREF(__pyx_t_1);
6226 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6227 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6228 __PYX_ERR(1, 2, __pyx_L1_error)
6238 __Pyx_XDECREF(__pyx_t_1);
6239 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6241 __Pyx_XGIVEREF(__pyx_r);
6242 __Pyx_TraceReturn(__pyx_r, 0);
6243 __Pyx_RefNannyFinishContext();
6255 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6256 static char __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__[] =
"pycLinearOperator.__setstate_cython__(self, __pyx_state)";
6257 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__};
6258 static PyObject *__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6259 PyObject *__pyx_r = 0;
6260 __Pyx_RefNannyDeclarations
6261 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6262 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6265 __Pyx_RefNannyFinishContext();
6269 static PyObject *__pyx_pf_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6270 PyObject *__pyx_r = NULL;
6271 __Pyx_TraceDeclarations
6272 __Pyx_RefNannyDeclarations
6273 PyObject *__pyx_t_1 = NULL;
6274 int __pyx_lineno = 0;
6275 const char *__pyx_filename = NULL;
6276 int __pyx_clineno = 0;
6277 __Pyx_TraceFrameInit(__pyx_codeobj__16)
6278 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6279 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6286 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6287 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6288 __Pyx_GOTREF(__pyx_t_1);
6289 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6291 __PYX_ERR(1, 4, __pyx_L1_error)
6302 __Pyx_XDECREF(__pyx_t_1);
6303 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_linear_operator.pycLinearOperator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6305 __Pyx_XGIVEREF(__pyx_r);
6306 __Pyx_TraceReturn(__pyx_r, 0);
6307 __Pyx_RefNannyFinishContext();
6320 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6321 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6322 PyObject *__pyx_v_shape = 0;
6323 Py_ssize_t __pyx_v_itemsize;
6324 PyObject *__pyx_v_format = 0;
6325 PyObject *__pyx_v_mode = 0;
6326 int __pyx_v_allocate_buffer;
6327 int __pyx_lineno = 0;
6328 const char *__pyx_filename = NULL;
6329 int __pyx_clineno = 0;
6331 __Pyx_RefNannyDeclarations
6332 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6334 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6335 PyObject* values[5] = {0,0,0,0,0};
6336 values[3] = ((PyObject *)__pyx_n_s_c);
6337 if (unlikely(__pyx_kwds)) {
6339 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6341 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6343 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6345 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6347 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6349 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6352 default:
goto __pyx_L5_argtuple_error;
6354 kw_args = PyDict_Size(__pyx_kwds);
6357 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6358 else goto __pyx_L5_argtuple_error;
6361 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6363 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
6367 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6369 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
6374 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6375 if (value) { values[3] = value; kw_args--; }
6380 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6381 if (value) { values[4] = value; kw_args--; }
6384 if (unlikely(kw_args > 0)) {
6385 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
6388 switch (PyTuple_GET_SIZE(__pyx_args)) {
6389 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6391 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6393 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6394 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6395 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6397 default:
goto __pyx_L5_argtuple_error;
6400 __pyx_v_shape = ((PyObject*)values[0]);
6401 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
6402 __pyx_v_format = values[2];
6403 __pyx_v_mode = values[3];
6405 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
6415 __pyx_v_allocate_buffer = ((int)1);
6418 goto __pyx_L4_argument_unpacking_done;
6419 __pyx_L5_argtuple_error:;
6420 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
6422 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6423 __Pyx_RefNannyFinishContext();
6425 __pyx_L4_argument_unpacking_done:;
6426 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
6427 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6428 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 123, __pyx_L1_error)
6430 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6445 __Pyx_RefNannyFinishContext();
6449 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
6451 Py_ssize_t __pyx_v_i;
6452 Py_ssize_t __pyx_v_dim;
6453 PyObject **__pyx_v_p;
6456 __Pyx_TraceDeclarations
6457 __Pyx_RefNannyDeclarations
6458 Py_ssize_t __pyx_t_1;
6460 PyObject *__pyx_t_3 = NULL;
6462 PyObject *__pyx_t_5 = NULL;
6463 PyObject *__pyx_t_6 = NULL;
6466 Py_ssize_t __pyx_t_9;
6467 PyObject *__pyx_t_10 = NULL;
6468 Py_ssize_t __pyx_t_11;
6469 int __pyx_lineno = 0;
6470 const char *__pyx_filename = NULL;
6471 int __pyx_clineno = 0;
6472 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6473 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
6474 __Pyx_INCREF(__pyx_v_format);
6483 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
6484 if (unlikely(__pyx_v_shape == Py_None)) {
6485 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6486 __PYX_ERR(1, 130, __pyx_L1_error)
6488 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
6489 __pyx_v_self->ndim = ((int)__pyx_t_1);
6498 __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
6499 __pyx_v_self->itemsize = __pyx_v_itemsize;
6508 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
6509 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6510 if (unlikely(__pyx_t_2)) {
6519 __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
6520 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
6521 __Pyx_GOTREF(__pyx_t_3);
6522 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6523 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6524 __PYX_ERR(1, 134, __pyx_L1_error)
6542 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
6543 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6544 if (unlikely(__pyx_t_2)) {
6553 __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
6554 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
6555 __Pyx_GOTREF(__pyx_t_3);
6556 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6558 __PYX_ERR(1, 137, __pyx_L1_error)
6576 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
6577 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6578 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6588 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
6589 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
6590 __Pyx_GOTREF(__pyx_t_5);
6592 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6593 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6594 if (likely(__pyx_t_6)) {
6595 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
6596 __Pyx_INCREF(__pyx_t_6);
6597 __Pyx_INCREF(
function);
6598 __Pyx_DECREF_SET(__pyx_t_5,
function);
6601 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
6602 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6603 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
6604 __Pyx_GOTREF(__pyx_t_3);
6605 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6606 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6625 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
6626 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
6627 __pyx_t_3 = __pyx_v_format;
6628 __Pyx_INCREF(__pyx_t_3);
6629 __Pyx_GIVEREF(__pyx_t_3);
6630 __Pyx_GOTREF(__pyx_v_self->_format);
6631 __Pyx_DECREF(__pyx_v_self->_format);
6632 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6642 __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
6643 if (unlikely(__pyx_v_self->_format == Py_None)) {
6644 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
6645 __PYX_ERR(1, 142, __pyx_L1_error)
6647 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
6648 __pyx_v_self->format = __pyx_t_7;
6657 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
6658 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6667 __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
6668 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6677 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
6678 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6679 if (unlikely(__pyx_t_4)) {
6688 __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
6689 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
6690 __Pyx_GOTREF(__pyx_t_3);
6691 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6693 __PYX_ERR(1, 149, __pyx_L1_error)
6711 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
6713 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6715 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
6716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6717 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
6719 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
6720 __Pyx_GOTREF(__pyx_t_5);
6722 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
6723 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6724 __pyx_v_dim = __pyx_t_9;
6725 __pyx_v_idx = __pyx_t_8;
6726 __pyx_t_8 = (__pyx_t_8 + 1);
6735 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
6736 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6737 if (unlikely(__pyx_t_4)) {
6746 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
6747 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
6748 __Pyx_GOTREF(__pyx_t_5);
6749 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
6750 __Pyx_GOTREF(__pyx_t_6);
6751 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
6752 __Pyx_GOTREF(__pyx_t_10);
6753 __Pyx_GIVEREF(__pyx_t_5);
6754 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6755 __Pyx_GIVEREF(__pyx_t_6);
6756 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6759 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
6760 __Pyx_GOTREF(__pyx_t_6);
6761 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6762 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
6763 __Pyx_GOTREF(__pyx_t_10);
6764 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6765 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6766 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6767 __PYX_ERR(1, 154, __pyx_L1_error)
6785 __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
6786 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6795 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
6797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6806 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
6807 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
6817 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
6818 __pyx_v_order =
'F';
6827 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
6828 __Pyx_INCREF(__pyx_n_u_fortran);
6829 __Pyx_GIVEREF(__pyx_n_u_fortran);
6830 __Pyx_GOTREF(__pyx_v_self->mode);
6831 __Pyx_DECREF(__pyx_v_self->mode);
6832 __pyx_v_self->mode = __pyx_n_u_fortran;
6851 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
6852 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
6853 if (likely(__pyx_t_4)) {
6862 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
6863 __pyx_v_order =
'C';
6872 __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
6873 __Pyx_INCREF(__pyx_n_u_c);
6874 __Pyx_GIVEREF(__pyx_n_u_c);
6875 __Pyx_GOTREF(__pyx_v_self->mode);
6876 __Pyx_DECREF(__pyx_v_self->mode);
6877 __pyx_v_self->mode = __pyx_n_u_c;
6896 __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
6898 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
6899 __Pyx_GOTREF(__pyx_t_3);
6900 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
6901 __Pyx_GOTREF(__pyx_t_10);
6902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6903 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6904 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6905 __PYX_ERR(1, 165, __pyx_L1_error)
6916 __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
6917 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6926 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
6927 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6936 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
6937 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
6938 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
6939 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6940 __pyx_v_self->dtype_is_object = __pyx_t_4;
6949 __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
6950 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6960 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
6961 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
6970 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
6971 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6972 if (unlikely(__pyx_t_4)) {
6981 __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
6982 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
6983 __Pyx_GOTREF(__pyx_t_10);
6984 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6985 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6986 __PYX_ERR(1, 177, __pyx_L1_error)
7004 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7005 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7015 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7016 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7025 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7026 if (unlikely(__pyx_v_itemsize == 0)) {
7027 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7028 __PYX_ERR(1, 181, __pyx_L1_error)
7030 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7031 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7032 __PYX_ERR(1, 181, __pyx_L1_error)
7034 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7035 __pyx_t_9 = __pyx_t_1;
7036 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7037 __pyx_v_i = __pyx_t_11;
7046 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7047 (__pyx_v_p[__pyx_v_i]) = Py_None;
7056 __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
7090 __Pyx_XDECREF(__pyx_t_3);
7091 __Pyx_XDECREF(__pyx_t_5);
7092 __Pyx_XDECREF(__pyx_t_6);
7093 __Pyx_XDECREF(__pyx_t_10);
7094 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7097 __Pyx_XDECREF(__pyx_v_format);
7098 __Pyx_TraceReturn(Py_None, 0);
7099 __Pyx_RefNannyFinishContext();
7112 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7113 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7115 __Pyx_RefNannyDeclarations
7116 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7117 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7120 __Pyx_RefNannyFinishContext();
7124 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7125 int __pyx_v_bufmode;
7127 __Pyx_TraceDeclarations
7128 __Pyx_RefNannyDeclarations
7131 PyObject *__pyx_t_3 = NULL;
7133 Py_ssize_t __pyx_t_5;
7135 Py_ssize_t *__pyx_t_7;
7136 int __pyx_lineno = 0;
7137 const char *__pyx_filename = NULL;
7138 int __pyx_clineno = 0;
7139 if (__pyx_v_info == NULL) {
7140 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7143 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7144 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7145 __Pyx_GIVEREF(__pyx_v_info->obj);
7146 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
7155 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7156 __pyx_v_bufmode = -1;
7165 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7166 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
7167 __pyx_t_2 = (__pyx_t_1 != 0);
7177 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7178 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7197 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7198 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
7199 __pyx_t_1 = (__pyx_t_2 != 0);
7209 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7210 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7229 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7230 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7231 if (unlikely(__pyx_t_1)) {
7240 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7241 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
7242 __Pyx_GOTREF(__pyx_t_3);
7243 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7244 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7245 __PYX_ERR(1, 193, __pyx_L1_error)
7263 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7264 __pyx_t_4 = __pyx_v_self->data;
7265 __pyx_v_info->buf = __pyx_t_4;
7274 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7275 __pyx_t_5 = __pyx_v_self->len;
7276 __pyx_v_info->len = __pyx_t_5;
7285 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7286 __pyx_t_6 = __pyx_v_self->ndim;
7287 __pyx_v_info->ndim = __pyx_t_6;
7296 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7297 __pyx_t_7 = __pyx_v_self->_shape;
7298 __pyx_v_info->shape = __pyx_t_7;
7307 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7308 __pyx_t_7 = __pyx_v_self->_strides;
7309 __pyx_v_info->strides = __pyx_t_7;
7318 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
7319 __pyx_v_info->suboffsets = NULL;
7328 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
7329 __pyx_t_5 = __pyx_v_self->itemsize;
7330 __pyx_v_info->itemsize = __pyx_t_5;
7339 __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
7340 __pyx_v_info->readonly = 0;
7349 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
7350 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7360 __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
7361 __pyx_t_4 = __pyx_v_self->format;
7362 __pyx_v_info->format = __pyx_t_4;
7381 __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
7383 __pyx_v_info->format = NULL;
7394 __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
7395 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7396 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7397 __Pyx_GOTREF(__pyx_v_info->obj);
7398 __Pyx_DECREF(__pyx_v_info->obj);
7399 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7413 __Pyx_XDECREF(__pyx_t_3);
7414 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7416 if (__pyx_v_info->obj != NULL) {
7417 __Pyx_GOTREF(__pyx_v_info->obj);
7418 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7422 if (__pyx_v_info->obj == Py_None) {
7423 __Pyx_GOTREF(__pyx_v_info->obj);
7424 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7427 __Pyx_TraceReturn(Py_None, 0);
7428 __Pyx_RefNannyFinishContext();
7441 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
7442 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7443 __Pyx_RefNannyDeclarations
7444 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7445 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
7448 __Pyx_RefNannyFinishContext();
7451 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
7452 __Pyx_TraceDeclarations
7453 __Pyx_RefNannyDeclarations
7455 int __pyx_lineno = 0;
7456 const char *__pyx_filename = NULL;
7457 int __pyx_clineno = 0;
7458 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7459 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
7468 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
7469 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7479 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
7480 __pyx_v_self->callback_free_data(__pyx_v_self->data);
7499 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
7500 __pyx_t_1 = (__pyx_v_self->free_data != 0);
7510 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
7511 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7521 __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
7522 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7540 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
7541 free(__pyx_v_self->data);
7560 __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
7561 PyObject_Free(__pyx_v_self->_shape);
7574 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7576 __Pyx_TraceReturn(Py_None, 0);
7577 __Pyx_RefNannyFinishContext();
7589 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
7590 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7591 PyObject *__pyx_r = 0;
7592 __Pyx_RefNannyDeclarations
7593 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
7594 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
7597 __Pyx_RefNannyFinishContext();
7601 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
7602 PyObject *__pyx_r = NULL;
7603 __Pyx_TraceDeclarations
7604 __Pyx_RefNannyDeclarations
7605 PyObject *__pyx_t_1 = NULL;
7606 int __pyx_lineno = 0;
7607 const char *__pyx_filename = NULL;
7608 int __pyx_clineno = 0;
7609 __Pyx_RefNannySetupContext(
"__get__", 0);
7610 __Pyx_TraceCall(
"__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
7619 __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
7620 __Pyx_XDECREF(__pyx_r);
7621 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
7622 __Pyx_GOTREF(__pyx_t_1);
7623 __pyx_r = __pyx_t_1;
7637 __Pyx_XDECREF(__pyx_t_1);
7638 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7641 __Pyx_XGIVEREF(__pyx_r);
7642 __Pyx_TraceReturn(__pyx_r, 0);
7643 __Pyx_RefNannyFinishContext();
7655 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
7657 PyObject *__pyx_r = NULL;
7658 __Pyx_TraceDeclarations
7659 __Pyx_RefNannyDeclarations
7660 PyObject *__pyx_t_1 = NULL;
7661 PyObject *__pyx_t_2 = NULL;
7662 PyObject *__pyx_t_3 = NULL;
7663 int __pyx_lineno = 0;
7664 const char *__pyx_filename = NULL;
7665 int __pyx_clineno = 0;
7666 __Pyx_RefNannySetupContext(
"get_memview", 0);
7667 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
7676 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
7677 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7686 __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
7687 __Pyx_XDECREF(__pyx_r);
7688 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
7689 __Pyx_GOTREF(__pyx_t_1);
7690 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
7691 __Pyx_GOTREF(__pyx_t_2);
7692 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_3);
7694 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7695 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7696 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7697 __Pyx_GIVEREF(__pyx_t_1);
7698 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7699 __Pyx_GIVEREF(__pyx_t_2);
7700 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7703 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
7704 __Pyx_GOTREF(__pyx_t_2);
7705 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7706 __pyx_r = __pyx_t_2;
7720 __Pyx_XDECREF(__pyx_t_1);
7721 __Pyx_XDECREF(__pyx_t_2);
7722 __Pyx_XDECREF(__pyx_t_3);
7723 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7726 __Pyx_XGIVEREF(__pyx_r);
7727 __Pyx_TraceReturn(__pyx_r, 0);
7728 __Pyx_RefNannyFinishContext();
7741 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
7742 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7744 __Pyx_RefNannyDeclarations
7745 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
7746 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
7749 __Pyx_RefNannyFinishContext();
7753 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
7755 __Pyx_TraceDeclarations
7756 __Pyx_RefNannyDeclarations
7757 int __pyx_lineno = 0;
7758 const char *__pyx_filename = NULL;
7759 int __pyx_clineno = 0;
7760 __Pyx_RefNannySetupContext(
"__len__", 0);
7761 __Pyx_TraceCall(
"__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
7770 __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
7771 __pyx_r = (__pyx_v_self->_shape[0]);
7784 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7787 __Pyx_TraceReturn(Py_None, 0);
7788 __Pyx_RefNannyFinishContext();
7801 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
7802 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7803 PyObject *__pyx_r = 0;
7804 __Pyx_RefNannyDeclarations
7805 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
7806 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7809 __Pyx_RefNannyFinishContext();
7813 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7814 PyObject *__pyx_r = NULL;
7815 __Pyx_TraceDeclarations
7816 __Pyx_RefNannyDeclarations
7817 PyObject *__pyx_t_1 = NULL;
7818 PyObject *__pyx_t_2 = NULL;
7819 int __pyx_lineno = 0;
7820 const char *__pyx_filename = NULL;
7821 int __pyx_clineno = 0;
7822 __Pyx_RefNannySetupContext(
"__getattr__", 0);
7823 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
7832 __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
7833 __Pyx_XDECREF(__pyx_r);
7834 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
7835 __Pyx_GOTREF(__pyx_t_1);
7836 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
7837 __Pyx_GOTREF(__pyx_t_2);
7838 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7839 __pyx_r = __pyx_t_2;
7853 __Pyx_XDECREF(__pyx_t_1);
7854 __Pyx_XDECREF(__pyx_t_2);
7855 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7858 __Pyx_XGIVEREF(__pyx_r);
7859 __Pyx_TraceReturn(__pyx_r, 0);
7860 __Pyx_RefNannyFinishContext();
7873 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
7874 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7875 PyObject *__pyx_r = 0;
7876 __Pyx_RefNannyDeclarations
7877 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
7878 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7881 __Pyx_RefNannyFinishContext();
7885 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7886 PyObject *__pyx_r = NULL;
7887 __Pyx_TraceDeclarations
7888 __Pyx_RefNannyDeclarations
7889 PyObject *__pyx_t_1 = NULL;
7890 PyObject *__pyx_t_2 = NULL;
7891 int __pyx_lineno = 0;
7892 const char *__pyx_filename = NULL;
7893 int __pyx_clineno = 0;
7894 __Pyx_RefNannySetupContext(
"__getitem__", 0);
7895 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
7904 __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
7905 __Pyx_XDECREF(__pyx_r);
7906 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
7907 __Pyx_GOTREF(__pyx_t_1);
7908 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
7909 __Pyx_GOTREF(__pyx_t_2);
7910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7911 __pyx_r = __pyx_t_2;
7925 __Pyx_XDECREF(__pyx_t_1);
7926 __Pyx_XDECREF(__pyx_t_2);
7927 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7930 __Pyx_XGIVEREF(__pyx_r);
7931 __Pyx_TraceReturn(__pyx_r, 0);
7932 __Pyx_RefNannyFinishContext();
7945 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
7946 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7948 __Pyx_RefNannyDeclarations
7949 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
7950 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7953 __Pyx_RefNannyFinishContext();
7957 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7959 __Pyx_TraceDeclarations
7960 __Pyx_RefNannyDeclarations
7961 PyObject *__pyx_t_1 = NULL;
7962 int __pyx_lineno = 0;
7963 const char *__pyx_filename = NULL;
7964 int __pyx_clineno = 0;
7965 __Pyx_RefNannySetupContext(
"__setitem__", 0);
7966 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
7975 __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
7976 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
7977 __Pyx_GOTREF(__pyx_t_1);
7978 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
7979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7993 __Pyx_XDECREF(__pyx_t_1);
7994 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7997 __Pyx_TraceReturn(Py_None, 0);
7998 __Pyx_RefNannyFinishContext();
8009 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8010 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8011 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8012 PyObject *__pyx_r = 0;
8013 __Pyx_RefNannyDeclarations
8014 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8015 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8018 __Pyx_RefNannyFinishContext();
8022 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8023 PyObject *__pyx_r = NULL;
8024 __Pyx_TraceDeclarations
8025 __Pyx_RefNannyDeclarations
8026 PyObject *__pyx_t_1 = NULL;
8027 int __pyx_lineno = 0;
8028 const char *__pyx_filename = NULL;
8029 int __pyx_clineno = 0;
8030 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8031 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8039 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8040 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8041 __Pyx_GOTREF(__pyx_t_1);
8042 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8044 __PYX_ERR(1, 2, __pyx_L1_error)
8054 __Pyx_XDECREF(__pyx_t_1);
8055 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8057 __Pyx_XGIVEREF(__pyx_r);
8058 __Pyx_TraceReturn(__pyx_r, 0);
8059 __Pyx_RefNannyFinishContext();
8071 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8072 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8073 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8074 PyObject *__pyx_r = 0;
8075 __Pyx_RefNannyDeclarations
8076 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8077 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8080 __Pyx_RefNannyFinishContext();
8084 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8085 PyObject *__pyx_r = NULL;
8086 __Pyx_TraceDeclarations
8087 __Pyx_RefNannyDeclarations
8088 PyObject *__pyx_t_1 = NULL;
8089 int __pyx_lineno = 0;
8090 const char *__pyx_filename = NULL;
8091 int __pyx_clineno = 0;
8092 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8093 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8100 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8101 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8102 __Pyx_GOTREF(__pyx_t_1);
8103 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8105 __PYX_ERR(1, 4, __pyx_L1_error)
8116 __Pyx_XDECREF(__pyx_t_1);
8117 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8119 __Pyx_XGIVEREF(__pyx_r);
8120 __Pyx_TraceReturn(__pyx_r, 0);
8121 __Pyx_RefNannyFinishContext();
8133 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8134 struct __pyx_array_obj *__pyx_v_result = 0;
8135 struct __pyx_array_obj *__pyx_r = NULL;
8136 __Pyx_TraceDeclarations
8137 __Pyx_RefNannyDeclarations
8139 PyObject *__pyx_t_2 = NULL;
8140 PyObject *__pyx_t_3 = NULL;
8141 PyObject *__pyx_t_4 = NULL;
8142 PyObject *__pyx_t_5 = NULL;
8143 int __pyx_lineno = 0;
8144 const char *__pyx_filename = NULL;
8145 int __pyx_clineno = 0;
8146 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8147 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
8156 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8157 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8167 __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
8168 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
8169 __Pyx_GOTREF(__pyx_t_2);
8170 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
8171 __Pyx_GOTREF(__pyx_t_3);
8172 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8173 __Pyx_GOTREF(__pyx_t_4);
8174 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
8175 __Pyx_GOTREF(__pyx_t_5);
8176 __Pyx_INCREF(__pyx_v_shape);
8177 __Pyx_GIVEREF(__pyx_v_shape);
8178 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8179 __Pyx_GIVEREF(__pyx_t_2);
8180 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8181 __Pyx_GIVEREF(__pyx_t_3);
8182 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8183 __Pyx_GIVEREF(__pyx_t_4);
8184 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8188 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
8189 __Pyx_GOTREF(__pyx_t_4);
8190 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8191 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8211 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8213 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
8214 __Pyx_GOTREF(__pyx_t_4);
8215 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8216 __Pyx_GOTREF(__pyx_t_5);
8217 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8218 __Pyx_GOTREF(__pyx_t_3);
8219 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
8220 __Pyx_GOTREF(__pyx_t_2);
8221 __Pyx_INCREF(__pyx_v_shape);
8222 __Pyx_GIVEREF(__pyx_v_shape);
8223 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8224 __Pyx_GIVEREF(__pyx_t_4);
8225 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8226 __Pyx_GIVEREF(__pyx_t_5);
8227 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8228 __Pyx_GIVEREF(__pyx_t_3);
8229 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8241 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8242 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
8243 __Pyx_GOTREF(__pyx_t_3);
8244 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
8253 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8254 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
8255 __Pyx_GOTREF(__pyx_t_5);
8256 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8258 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
8268 __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
8269 __pyx_v_result->data = __pyx_v_buf;
8280 __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
8281 __Pyx_XDECREF(((PyObject *)__pyx_r));
8282 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8283 __pyx_r = __pyx_v_result;
8296 __Pyx_XDECREF(__pyx_t_2);
8297 __Pyx_XDECREF(__pyx_t_3);
8298 __Pyx_XDECREF(__pyx_t_4);
8299 __Pyx_XDECREF(__pyx_t_5);
8300 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8303 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8304 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8305 __Pyx_TraceReturn(__pyx_r, 0);
8306 __Pyx_RefNannyFinishContext();
8319 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8320 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8321 PyObject *__pyx_v_name = 0;
8322 int __pyx_lineno = 0;
8323 const char *__pyx_filename = NULL;
8324 int __pyx_clineno = 0;
8326 __Pyx_RefNannyDeclarations
8327 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
8329 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8330 PyObject* values[1] = {0};
8331 if (unlikely(__pyx_kwds)) {
8333 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8335 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8338 default:
goto __pyx_L5_argtuple_error;
8340 kw_args = PyDict_Size(__pyx_kwds);
8343 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8344 else goto __pyx_L5_argtuple_error;
8346 if (unlikely(kw_args > 0)) {
8347 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
8349 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8350 goto __pyx_L5_argtuple_error;
8352 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8354 __pyx_v_name = values[0];
8356 goto __pyx_L4_argument_unpacking_done;
8357 __pyx_L5_argtuple_error:;
8358 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
8360 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8361 __Pyx_RefNannyFinishContext();
8363 __pyx_L4_argument_unpacking_done:;
8364 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8367 __Pyx_RefNannyFinishContext();
8371 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8373 __Pyx_TraceDeclarations
8374 __Pyx_RefNannyDeclarations
8375 int __pyx_lineno = 0;
8376 const char *__pyx_filename = NULL;
8377 int __pyx_clineno = 0;
8378 __Pyx_RefNannySetupContext(
"__init__", 0);
8379 __Pyx_TraceCall(
"__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
8388 __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
8389 __Pyx_INCREF(__pyx_v_name);
8390 __Pyx_GIVEREF(__pyx_v_name);
8391 __Pyx_GOTREF(__pyx_v_self->name);
8392 __Pyx_DECREF(__pyx_v_self->name);
8393 __pyx_v_self->name = __pyx_v_name;
8407 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8410 __Pyx_TraceReturn(Py_None, 0);
8411 __Pyx_RefNannyFinishContext();
8424 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
8425 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8426 PyObject *__pyx_r = 0;
8427 __Pyx_RefNannyDeclarations
8428 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
8429 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8432 __Pyx_RefNannyFinishContext();
8436 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8437 PyObject *__pyx_r = NULL;
8438 __Pyx_TraceDeclarations
8439 __Pyx_RefNannyDeclarations
8440 int __pyx_lineno = 0;
8441 const char *__pyx_filename = NULL;
8442 int __pyx_clineno = 0;
8443 __Pyx_RefNannySetupContext(
"__repr__", 0);
8444 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
8453 __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
8454 __Pyx_XDECREF(__pyx_r);
8455 __Pyx_INCREF(__pyx_v_self->name);
8456 __pyx_r = __pyx_v_self->name;
8469 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8472 __Pyx_XGIVEREF(__pyx_r);
8473 __Pyx_TraceReturn(__pyx_r, 0);
8474 __Pyx_RefNannyFinishContext();
8485 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8486 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8487 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8488 PyObject *__pyx_r = 0;
8489 __Pyx_RefNannyDeclarations
8490 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8491 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8494 __Pyx_RefNannyFinishContext();
8498 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8499 PyObject *__pyx_v_state = 0;
8500 PyObject *__pyx_v__dict = 0;
8501 int __pyx_v_use_setstate;
8502 PyObject *__pyx_r = NULL;
8503 __Pyx_TraceDeclarations
8504 __Pyx_RefNannyDeclarations
8505 PyObject *__pyx_t_1 = NULL;
8508 PyObject *__pyx_t_4 = NULL;
8509 PyObject *__pyx_t_5 = NULL;
8510 int __pyx_lineno = 0;
8511 const char *__pyx_filename = NULL;
8512 int __pyx_clineno = 0;
8513 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8514 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8523 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
8524 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_t_1);
8526 __Pyx_INCREF(__pyx_v_self->name);
8527 __Pyx_GIVEREF(__pyx_v_self->name);
8528 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8529 __pyx_v_state = ((PyObject*)__pyx_t_1);
8539 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
8540 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
8541 __Pyx_GOTREF(__pyx_t_1);
8542 __pyx_v__dict = __pyx_t_1;
8552 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
8553 __pyx_t_2 = (__pyx_v__dict != Py_None);
8554 __pyx_t_3 = (__pyx_t_2 != 0);
8564 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
8565 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
8566 __Pyx_GOTREF(__pyx_t_1);
8567 __Pyx_INCREF(__pyx_v__dict);
8568 __Pyx_GIVEREF(__pyx_v__dict);
8569 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8570 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
8571 __Pyx_GOTREF(__pyx_t_4);
8572 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8573 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8583 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
8584 __pyx_v_use_setstate = 1;
8603 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
8605 __pyx_t_3 = (__pyx_v_self->name != Py_None);
8606 __pyx_v_use_setstate = __pyx_t_3;
8617 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
8618 __pyx_t_3 = (__pyx_v_use_setstate != 0);
8628 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
8629 __Pyx_XDECREF(__pyx_r);
8630 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
8631 __Pyx_GOTREF(__pyx_t_4);
8632 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
8633 __Pyx_GOTREF(__pyx_t_1);
8634 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8635 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8636 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8637 __Pyx_INCREF(__pyx_int_184977713);
8638 __Pyx_GIVEREF(__pyx_int_184977713);
8639 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8640 __Pyx_INCREF(Py_None);
8641 __Pyx_GIVEREF(Py_None);
8642 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8643 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
8644 __Pyx_GOTREF(__pyx_t_5);
8645 __Pyx_GIVEREF(__pyx_t_4);
8646 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8647 __Pyx_GIVEREF(__pyx_t_1);
8648 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8649 __Pyx_INCREF(__pyx_v_state);
8650 __Pyx_GIVEREF(__pyx_v_state);
8651 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8654 __pyx_r = __pyx_t_5;
8674 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
8676 __Pyx_XDECREF(__pyx_r);
8677 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
8678 __Pyx_GOTREF(__pyx_t_5);
8679 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
8680 __Pyx_GOTREF(__pyx_t_1);
8681 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8682 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8683 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8684 __Pyx_INCREF(__pyx_int_184977713);
8685 __Pyx_GIVEREF(__pyx_int_184977713);
8686 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8687 __Pyx_INCREF(__pyx_v_state);
8688 __Pyx_GIVEREF(__pyx_v_state);
8689 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8690 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
8691 __Pyx_GOTREF(__pyx_t_4);
8692 __Pyx_GIVEREF(__pyx_t_5);
8693 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8694 __Pyx_GIVEREF(__pyx_t_1);
8695 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8698 __pyx_r = __pyx_t_4;
8711 __Pyx_XDECREF(__pyx_t_1);
8712 __Pyx_XDECREF(__pyx_t_4);
8713 __Pyx_XDECREF(__pyx_t_5);
8714 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8717 __Pyx_XDECREF(__pyx_v_state);
8718 __Pyx_XDECREF(__pyx_v__dict);
8719 __Pyx_XGIVEREF(__pyx_r);
8720 __Pyx_TraceReturn(__pyx_r, 0);
8721 __Pyx_RefNannyFinishContext();
8733 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8734 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
8735 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8736 PyObject *__pyx_r = 0;
8737 __Pyx_RefNannyDeclarations
8738 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8739 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8742 __Pyx_RefNannyFinishContext();
8746 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8747 PyObject *__pyx_r = NULL;
8748 __Pyx_TraceDeclarations
8749 __Pyx_RefNannyDeclarations
8750 PyObject *__pyx_t_1 = NULL;
8751 int __pyx_lineno = 0;
8752 const char *__pyx_filename = NULL;
8753 int __pyx_clineno = 0;
8754 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8755 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
8762 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
8763 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
8764 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8765 __Pyx_GOTREF(__pyx_t_1);
8766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8776 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8779 __Pyx_XDECREF(__pyx_t_1);
8780 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8783 __Pyx_XGIVEREF(__pyx_r);
8784 __Pyx_TraceReturn(__pyx_r, 0);
8785 __Pyx_RefNannyFinishContext();
8797 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
8798 Py_intptr_t __pyx_v_aligned_p;
8799 size_t __pyx_v_offset;
8801 __Pyx_TraceDeclarations
8803 int __pyx_lineno = 0;
8804 const char *__pyx_filename = NULL;
8805 int __pyx_clineno = 0;
8806 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
8815 __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
8816 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8825 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8834 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
8835 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8845 __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
8846 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8864 __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
8865 __pyx_r = ((
void *)__pyx_v_aligned_p);
8878 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
8881 __Pyx_TraceReturn(Py_None, 1);
8894 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8895 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8896 PyObject *__pyx_v_obj = 0;
8898 int __pyx_v_dtype_is_object;
8899 int __pyx_lineno = 0;
8900 const char *__pyx_filename = NULL;
8901 int __pyx_clineno = 0;
8903 __Pyx_RefNannyDeclarations
8904 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8906 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8907 PyObject* values[3] = {0,0,0};
8908 if (unlikely(__pyx_kwds)) {
8910 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8912 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8914 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8916 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8919 default:
goto __pyx_L5_argtuple_error;
8921 kw_args = PyDict_Size(__pyx_kwds);
8924 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8925 else goto __pyx_L5_argtuple_error;
8928 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8930 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
8935 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8936 if (value) { values[2] = value; kw_args--; }
8939 if (unlikely(kw_args > 0)) {
8940 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
8943 switch (PyTuple_GET_SIZE(__pyx_args)) {
8944 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8946 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8947 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8949 default:
goto __pyx_L5_argtuple_error;
8952 __pyx_v_obj = values[0];
8953 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
8955 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
8957 __pyx_v_dtype_is_object = ((int)0);
8960 goto __pyx_L4_argument_unpacking_done;
8961 __pyx_L5_argtuple_error:;
8962 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
8964 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8965 __Pyx_RefNannyFinishContext();
8967 __pyx_L4_argument_unpacking_done:;
8968 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8971 __Pyx_RefNannyFinishContext();
8975 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
8977 __Pyx_TraceDeclarations
8978 __Pyx_RefNannyDeclarations
8983 int __pyx_lineno = 0;
8984 const char *__pyx_filename = NULL;
8985 int __pyx_clineno = 0;
8986 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8987 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
8996 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
8997 __Pyx_INCREF(__pyx_v_obj);
8998 __Pyx_GIVEREF(__pyx_v_obj);
8999 __Pyx_GOTREF(__pyx_v_self->obj);
9000 __Pyx_DECREF(__pyx_v_self->obj);
9001 __pyx_v_self->obj = __pyx_v_obj;
9010 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9011 __pyx_v_self->flags = __pyx_v_flags;
9020 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9021 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9022 __pyx_t_3 = (__pyx_t_2 != 0);
9025 __pyx_t_1 = __pyx_t_3;
9026 goto __pyx_L4_bool_binop_done;
9028 __pyx_t_3 = (__pyx_v_obj != Py_None);
9029 __pyx_t_2 = (__pyx_t_3 != 0);
9030 __pyx_t_1 = __pyx_t_2;
9031 __pyx_L4_bool_binop_done:;
9041 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9042 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
9051 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9052 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9062 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9063 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9072 __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
9100 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9101 __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
9111 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9112 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9122 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9123 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9132 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9133 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9151 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9152 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9162 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9163 __pyx_v_self->lock = PyThread_allocate_lock();
9172 __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
9173 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9174 if (unlikely(__pyx_t_1)) {
9183 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9184 PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
9220 __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
9221 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9231 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9232 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
9235 __pyx_t_1 = __pyx_t_2;
9236 goto __pyx_L12_bool_binop_done;
9238 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
9239 __pyx_t_1 = __pyx_t_2;
9240 __pyx_L12_bool_binop_done:;
9241 __pyx_v_self->dtype_is_object = __pyx_t_1;
9260 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9262 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9273 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9274 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9283 __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
9284 __pyx_v_self->typeinfo = NULL;
9298 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9301 __Pyx_TraceReturn(Py_None, 0);
9302 __Pyx_RefNannyFinishContext();
9315 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
9316 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9317 __Pyx_RefNannyDeclarations
9318 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9319 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
9322 __Pyx_RefNannyFinishContext();
9325 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
9327 __Pyx_TraceDeclarations
9328 __Pyx_RefNannyDeclarations
9334 PyThread_type_lock __pyx_t_6;
9335 PyThread_type_lock __pyx_t_7;
9336 int __pyx_lineno = 0;
9337 const char *__pyx_filename = NULL;
9338 int __pyx_clineno = 0;
9339 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9340 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
9349 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
9350 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9351 __pyx_t_2 = (__pyx_t_1 != 0);
9361 __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
9362 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9381 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
9382 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9392 __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
9393 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9402 __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
9422 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
9423 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9433 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
9434 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9435 __pyx_t_4 = __pyx_t_3;
9436 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9437 __pyx_v_i = __pyx_t_5;
9446 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
9447 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9457 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
9458 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9467 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
9468 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9478 __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
9479 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9480 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9489 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
9490 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9491 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9509 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
9510 goto __pyx_L6_break;
9530 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
9531 PyThread_free_lock(__pyx_v_self->lock);
9555 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
9557 __Pyx_TraceReturn(Py_None, 0);
9558 __Pyx_RefNannyFinishContext();
9569 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9570 Py_ssize_t __pyx_v_dim;
9571 char *__pyx_v_itemp;
9572 PyObject *__pyx_v_idx = NULL;
9574 __Pyx_TraceDeclarations
9575 __Pyx_RefNannyDeclarations
9576 Py_ssize_t __pyx_t_1;
9577 PyObject *__pyx_t_2 = NULL;
9578 Py_ssize_t __pyx_t_3;
9579 PyObject *(*__pyx_t_4)(PyObject *);
9580 PyObject *__pyx_t_5 = NULL;
9581 Py_ssize_t __pyx_t_6;
9583 int __pyx_lineno = 0;
9584 const char *__pyx_filename = NULL;
9585 int __pyx_clineno = 0;
9586 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
9587 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
9596 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
9597 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
9606 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
9608 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9609 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9612 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
9613 __Pyx_GOTREF(__pyx_t_2);
9614 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
9617 if (likely(!__pyx_t_4)) {
9618 if (likely(PyList_CheckExact(__pyx_t_2))) {
9619 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
9620 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9621 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
9623 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
9624 __Pyx_GOTREF(__pyx_t_5);
9627 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
9628 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9629 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
9631 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
9632 __Pyx_GOTREF(__pyx_t_5);
9636 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9637 if (unlikely(!__pyx_t_5)) {
9638 PyObject* exc_type = PyErr_Occurred();
9640 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9641 else __PYX_ERR(1, 399, __pyx_L1_error)
9645 __Pyx_GOTREF(__pyx_t_5);
9647 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9649 __pyx_v_dim = __pyx_t_1;
9650 __pyx_t_1 = (__pyx_t_1 + 1);
9659 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
9660 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
9661 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
9662 __pyx_v_itemp = __pyx_t_7;
9671 __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
9673 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9682 __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
9683 __pyx_r = __pyx_v_itemp;
9696 __Pyx_XDECREF(__pyx_t_2);
9697 __Pyx_XDECREF(__pyx_t_5);
9698 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9701 __Pyx_XDECREF(__pyx_v_idx);
9702 __Pyx_TraceReturn(Py_None, 0);
9703 __Pyx_RefNannyFinishContext();
9716 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
9717 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9718 PyObject *__pyx_r = 0;
9719 __Pyx_RefNannyDeclarations
9720 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9721 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9724 __Pyx_RefNannyFinishContext();
9728 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9729 PyObject *__pyx_v_have_slices = NULL;
9730 PyObject *__pyx_v_indices = NULL;
9731 char *__pyx_v_itemp;
9732 PyObject *__pyx_r = NULL;
9733 __Pyx_TraceDeclarations
9734 __Pyx_RefNannyDeclarations
9737 PyObject *__pyx_t_3 = NULL;
9738 PyObject *__pyx_t_4 = NULL;
9739 PyObject *__pyx_t_5 = NULL;
9741 int __pyx_lineno = 0;
9742 const char *__pyx_filename = NULL;
9743 int __pyx_clineno = 0;
9744 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9745 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
9754 __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
9755 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9756 __pyx_t_2 = (__pyx_t_1 != 0);
9766 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
9767 __Pyx_XDECREF(__pyx_r);
9768 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9769 __pyx_r = ((PyObject *)__pyx_v_self);
9788 __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
9789 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
9790 __Pyx_GOTREF(__pyx_t_3);
9791 if (likely(__pyx_t_3 != Py_None)) {
9792 PyObject* sequence = __pyx_t_3;
9793 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9794 if (unlikely(size != 2)) {
9795 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9796 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9797 __PYX_ERR(1, 409, __pyx_L1_error)
9799 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9800 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9801 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9802 __Pyx_INCREF(__pyx_t_4);
9803 __Pyx_INCREF(__pyx_t_5);
9805 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
9806 __Pyx_GOTREF(__pyx_t_4);
9807 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
9808 __Pyx_GOTREF(__pyx_t_5);
9810 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9812 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
9814 __pyx_v_have_slices = __pyx_t_4;
9816 __pyx_v_indices = __pyx_t_5;
9826 __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
9827 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
9837 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
9838 __Pyx_XDECREF(__pyx_r);
9839 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
9840 __Pyx_GOTREF(__pyx_t_3);
9841 __pyx_r = __pyx_t_3;
9861 __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
9863 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
9864 __pyx_v_itemp = __pyx_t_6;
9873 __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
9874 __Pyx_XDECREF(__pyx_r);
9875 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
9876 __Pyx_GOTREF(__pyx_t_3);
9877 __pyx_r = __pyx_t_3;
9892 __Pyx_XDECREF(__pyx_t_3);
9893 __Pyx_XDECREF(__pyx_t_4);
9894 __Pyx_XDECREF(__pyx_t_5);
9895 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9898 __Pyx_XDECREF(__pyx_v_have_slices);
9899 __Pyx_XDECREF(__pyx_v_indices);
9900 __Pyx_XGIVEREF(__pyx_r);
9901 __Pyx_TraceReturn(__pyx_r, 0);
9902 __Pyx_RefNannyFinishContext();
9915 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
9916 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9918 __Pyx_RefNannyDeclarations
9919 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9920 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9923 __Pyx_RefNannyFinishContext();
9927 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9928 PyObject *__pyx_v_have_slices = NULL;
9929 PyObject *__pyx_v_obj = NULL;
9931 __Pyx_TraceDeclarations
9932 __Pyx_RefNannyDeclarations
9934 PyObject *__pyx_t_2 = NULL;
9935 PyObject *__pyx_t_3 = NULL;
9936 PyObject *__pyx_t_4 = NULL;
9937 int __pyx_lineno = 0;
9938 const char *__pyx_filename = NULL;
9939 int __pyx_clineno = 0;
9940 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9941 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
9942 __Pyx_INCREF(__pyx_v_index);
9951 __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
9952 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9953 if (unlikely(__pyx_t_1)) {
9962 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
9963 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
9964 __Pyx_GOTREF(__pyx_t_2);
9965 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9966 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9967 __PYX_ERR(1, 420, __pyx_L1_error)
9985 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
9986 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
9987 __Pyx_GOTREF(__pyx_t_2);
9988 if (likely(__pyx_t_2 != Py_None)) {
9989 PyObject* sequence = __pyx_t_2;
9990 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9991 if (unlikely(size != 2)) {
9992 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9993 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9994 __PYX_ERR(1, 422, __pyx_L1_error)
9996 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9997 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9998 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9999 __Pyx_INCREF(__pyx_t_3);
10000 __Pyx_INCREF(__pyx_t_4);
10002 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
10003 __Pyx_GOTREF(__pyx_t_3);
10004 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
10005 __Pyx_GOTREF(__pyx_t_4);
10007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10009 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
10011 __pyx_v_have_slices = __pyx_t_3;
10013 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10023 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10024 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10034 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10035 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10036 __Pyx_GOTREF(__pyx_t_2);
10037 __pyx_v_obj = __pyx_t_2;
10047 __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
10048 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
10058 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10059 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10060 __Pyx_GOTREF(__pyx_t_2);
10061 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10062 __Pyx_GOTREF(__pyx_t_4);
10063 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10064 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10083 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10085 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
10086 __Pyx_GOTREF(__pyx_t_4);
10087 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
10088 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10089 __Pyx_GOTREF(__pyx_t_2);
10090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10091 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10112 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
10114 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
10115 __Pyx_GOTREF(__pyx_t_2);
10116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10132 __Pyx_XDECREF(__pyx_t_2);
10133 __Pyx_XDECREF(__pyx_t_3);
10134 __Pyx_XDECREF(__pyx_t_4);
10135 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10138 __Pyx_XDECREF(__pyx_v_have_slices);
10139 __Pyx_XDECREF(__pyx_v_obj);
10140 __Pyx_XDECREF(__pyx_v_index);
10141 __Pyx_TraceReturn(Py_None, 0);
10142 __Pyx_RefNannyFinishContext();
10154 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10155 PyObject *__pyx_r = NULL;
10156 __Pyx_TraceDeclarations
10157 __Pyx_RefNannyDeclarations
10160 PyObject *__pyx_t_3 = NULL;
10161 PyObject *__pyx_t_4 = NULL;
10162 PyObject *__pyx_t_5 = NULL;
10163 PyObject *__pyx_t_6 = NULL;
10164 PyObject *__pyx_t_7 = NULL;
10165 PyObject *__pyx_t_8 = NULL;
10167 int __pyx_lineno = 0;
10168 const char *__pyx_filename = NULL;
10169 int __pyx_clineno = 0;
10170 __Pyx_RefNannySetupContext(
"is_slice", 0);
10171 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
10172 __Pyx_INCREF(__pyx_v_obj);
10181 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
10182 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10183 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10193 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
10195 __Pyx_PyThreadState_declare
10196 __Pyx_PyThreadState_assign
10197 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10198 __Pyx_XGOTREF(__pyx_t_3);
10199 __Pyx_XGOTREF(__pyx_t_4);
10200 __Pyx_XGOTREF(__pyx_t_5);
10210 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10211 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
10212 __Pyx_GOTREF(__pyx_t_6);
10221 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
10222 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
10223 __Pyx_GOTREF(__pyx_t_7);
10232 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
10233 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
10234 __Pyx_GOTREF(__pyx_t_8);
10235 __Pyx_INCREF(__pyx_v_obj);
10236 __Pyx_GIVEREF(__pyx_v_obj);
10237 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10238 __Pyx_GIVEREF(__pyx_t_6);
10239 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10240 __Pyx_GIVEREF(__pyx_t_7);
10241 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10244 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
10245 __Pyx_GOTREF(__pyx_t_7);
10246 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10247 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10258 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10259 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10260 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10261 goto __pyx_L9_try_end;
10263 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10264 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10265 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10274 __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
10275 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10277 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10278 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
10279 __Pyx_GOTREF(__pyx_t_7);
10280 __Pyx_GOTREF(__pyx_t_8);
10281 __Pyx_GOTREF(__pyx_t_6);
10290 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
10291 __Pyx_XDECREF(__pyx_r);
10292 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10293 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10294 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10295 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10296 goto __pyx_L7_except_return;
10298 goto __pyx_L6_except_error;
10299 __pyx_L6_except_error:;
10308 __Pyx_XGIVEREF(__pyx_t_3);
10309 __Pyx_XGIVEREF(__pyx_t_4);
10310 __Pyx_XGIVEREF(__pyx_t_5);
10311 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10312 goto __pyx_L1_error;
10313 __pyx_L7_except_return:;
10314 __Pyx_XGIVEREF(__pyx_t_3);
10315 __Pyx_XGIVEREF(__pyx_t_4);
10316 __Pyx_XGIVEREF(__pyx_t_5);
10317 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10338 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
10339 __Pyx_XDECREF(__pyx_r);
10340 __Pyx_INCREF(__pyx_v_obj);
10341 __pyx_r = __pyx_v_obj;
10354 __Pyx_XDECREF(__pyx_t_6);
10355 __Pyx_XDECREF(__pyx_t_7);
10356 __Pyx_XDECREF(__pyx_t_8);
10357 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10360 __Pyx_XDECREF(__pyx_v_obj);
10361 __Pyx_XGIVEREF(__pyx_r);
10362 __Pyx_TraceReturn(__pyx_r, 0);
10363 __Pyx_RefNannyFinishContext();
10375 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10376 __Pyx_memviewslice __pyx_v_dst_slice;
10377 __Pyx_memviewslice __pyx_v_src_slice;
10378 PyObject *__pyx_r = NULL;
10379 __Pyx_TraceDeclarations
10380 __Pyx_RefNannyDeclarations
10381 __Pyx_memviewslice *__pyx_t_1;
10382 __Pyx_memviewslice *__pyx_t_2;
10383 PyObject *__pyx_t_3 = NULL;
10387 int __pyx_lineno = 0;
10388 const char *__pyx_filename = NULL;
10389 int __pyx_clineno = 0;
10390 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
10391 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
10400 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10401 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
10402 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
10411 __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
10412 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
10413 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
10422 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
10423 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
10424 __Pyx_GOTREF(__pyx_t_3);
10425 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
10426 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10427 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
10428 __Pyx_GOTREF(__pyx_t_3);
10429 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
10430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10439 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10440 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
10451 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10454 __Pyx_XDECREF(__pyx_t_3);
10455 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10458 __Pyx_XGIVEREF(__pyx_r);
10459 __Pyx_TraceReturn(__pyx_r, 0);
10460 __Pyx_RefNannyFinishContext();
10472 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10473 int __pyx_v_array[0x80];
10475 void *__pyx_v_item;
10476 __Pyx_memviewslice *__pyx_v_dst_slice;
10477 __Pyx_memviewslice __pyx_v_tmp_slice;
10478 PyObject *__pyx_r = NULL;
10479 __Pyx_TraceDeclarations
10480 __Pyx_RefNannyDeclarations
10481 __Pyx_memviewslice *__pyx_t_1;
10483 PyObject *__pyx_t_3 = NULL;
10486 char const *__pyx_t_6;
10487 PyObject *__pyx_t_7 = NULL;
10488 PyObject *__pyx_t_8 = NULL;
10489 PyObject *__pyx_t_9 = NULL;
10490 PyObject *__pyx_t_10 = NULL;
10491 PyObject *__pyx_t_11 = NULL;
10492 PyObject *__pyx_t_12 = NULL;
10493 int __pyx_lineno = 0;
10494 const char *__pyx_filename = NULL;
10495 int __pyx_clineno = 0;
10496 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
10497 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
10506 __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
10507 __pyx_v_tmp = NULL;
10516 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
10517 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
10518 __pyx_v_dst_slice = __pyx_t_1;
10527 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
10528 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
10538 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
10539 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10548 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
10549 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10550 if (unlikely(__pyx_t_2)) {
10559 __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
10560 PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
10578 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
10579 __pyx_v_item = __pyx_v_tmp;
10598 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
10600 __pyx_v_item = ((
void *)__pyx_v_array);
10611 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
10621 __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
10622 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10632 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
10633 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10652 __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
10654 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
10655 __Pyx_GOTREF(__pyx_t_3);
10656 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10667 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
10668 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10678 __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
10679 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
10680 __Pyx_GOTREF(__pyx_t_3);
10681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10699 __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
10700 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10710 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
10713 PyMem_Free(__pyx_v_tmp);
10718 __Pyx_PyThreadState_declare
10719 __Pyx_PyThreadState_assign
10720 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10721 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10722 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10723 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10724 __Pyx_XGOTREF(__pyx_t_7);
10725 __Pyx_XGOTREF(__pyx_t_8);
10726 __Pyx_XGOTREF(__pyx_t_9);
10727 __Pyx_XGOTREF(__pyx_t_10);
10728 __Pyx_XGOTREF(__pyx_t_11);
10729 __Pyx_XGOTREF(__pyx_t_12);
10730 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10732 PyMem_Free(__pyx_v_tmp);
10734 if (PY_MAJOR_VERSION >= 3) {
10735 __Pyx_XGIVEREF(__pyx_t_10);
10736 __Pyx_XGIVEREF(__pyx_t_11);
10737 __Pyx_XGIVEREF(__pyx_t_12);
10738 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10740 __Pyx_XGIVEREF(__pyx_t_7);
10741 __Pyx_XGIVEREF(__pyx_t_8);
10742 __Pyx_XGIVEREF(__pyx_t_9);
10743 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10744 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10745 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10746 goto __pyx_L1_error;
10760 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10763 __Pyx_XDECREF(__pyx_t_3);
10764 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10767 __Pyx_XGIVEREF(__pyx_r);
10768 __Pyx_TraceReturn(__pyx_r, 0);
10769 __Pyx_RefNannyFinishContext();
10781 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10782 char *__pyx_v_itemp;
10783 PyObject *__pyx_r = NULL;
10784 __Pyx_TraceDeclarations
10785 __Pyx_RefNannyDeclarations
10787 PyObject *__pyx_t_2 = NULL;
10788 int __pyx_lineno = 0;
10789 const char *__pyx_filename = NULL;
10790 int __pyx_clineno = 0;
10791 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
10792 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
10801 __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
10802 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
10803 __pyx_v_itemp = __pyx_t_1;
10812 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
10813 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
10814 __Pyx_GOTREF(__pyx_t_2);
10815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10826 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10829 __Pyx_XDECREF(__pyx_t_2);
10830 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10833 __Pyx_XGIVEREF(__pyx_r);
10834 __Pyx_TraceReturn(__pyx_r, 0);
10835 __Pyx_RefNannyFinishContext();
10847 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
10848 PyObject *__pyx_v_struct = NULL;
10849 PyObject *__pyx_v_bytesitem = 0;
10850 PyObject *__pyx_v_result = NULL;
10851 PyObject *__pyx_r = NULL;
10852 __Pyx_TraceDeclarations
10853 __Pyx_RefNannyDeclarations
10854 PyObject *__pyx_t_1 = NULL;
10855 PyObject *__pyx_t_2 = NULL;
10856 PyObject *__pyx_t_3 = NULL;
10857 PyObject *__pyx_t_4 = NULL;
10858 PyObject *__pyx_t_5 = NULL;
10859 PyObject *__pyx_t_6 = NULL;
10860 PyObject *__pyx_t_7 = NULL;
10862 PyObject *__pyx_t_9 = NULL;
10865 int __pyx_lineno = 0;
10866 const char *__pyx_filename = NULL;
10867 int __pyx_clineno = 0;
10868 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
10869 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
10878 __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
10879 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
10880 __Pyx_GOTREF(__pyx_t_1);
10881 __pyx_v_struct = __pyx_t_1;
10891 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
10892 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
10893 __Pyx_GOTREF(__pyx_t_1);
10894 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10904 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
10906 __Pyx_PyThreadState_declare
10907 __Pyx_PyThreadState_assign
10908 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10909 __Pyx_XGOTREF(__pyx_t_2);
10910 __Pyx_XGOTREF(__pyx_t_3);
10911 __Pyx_XGOTREF(__pyx_t_4);
10921 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
10922 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
10923 __Pyx_GOTREF(__pyx_t_5);
10924 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
10925 __Pyx_GOTREF(__pyx_t_6);
10928 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10929 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10930 if (likely(__pyx_t_7)) {
10931 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
10932 __Pyx_INCREF(__pyx_t_7);
10933 __Pyx_INCREF(
function);
10934 __Pyx_DECREF_SET(__pyx_t_5,
function);
10938 #if CYTHON_FAST_PYCALL
10939 if (PyFunction_Check(__pyx_t_5)) {
10940 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10941 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
10942 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10943 __Pyx_GOTREF(__pyx_t_1);
10944 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10947 #if CYTHON_FAST_PYCCALL
10948 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10949 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10950 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
10951 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10952 __Pyx_GOTREF(__pyx_t_1);
10953 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10957 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
10958 __Pyx_GOTREF(__pyx_t_9);
10960 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10962 __Pyx_GIVEREF(__pyx_t_6);
10963 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10964 __Pyx_INCREF(__pyx_v_bytesitem);
10965 __Pyx_GIVEREF(__pyx_v_bytesitem);
10966 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10968 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
10969 __Pyx_GOTREF(__pyx_t_1);
10970 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10972 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10973 __pyx_v_result = __pyx_t_1;
10992 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
10994 __pyx_t_10 = strlen(__pyx_v_self->view.format);
10995 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11005 __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
11006 __Pyx_XDECREF(__pyx_r);
11007 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
11008 __Pyx_GOTREF(__pyx_t_1);
11009 __pyx_r = __pyx_t_1;
11011 goto __pyx_L6_except_return;
11029 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
11030 __Pyx_XDECREF(__pyx_r);
11031 __Pyx_INCREF(__pyx_v_result);
11032 __pyx_r = __pyx_v_result;
11033 goto __pyx_L6_except_return;
11036 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11037 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11038 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11039 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11040 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11049 __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
11050 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11051 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
11052 __Pyx_GOTREF(__pyx_t_6);
11053 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11054 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11055 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11056 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11058 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11059 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
11060 __Pyx_GOTREF(__pyx_t_9);
11061 __Pyx_GOTREF(__pyx_t_5);
11062 __Pyx_GOTREF(__pyx_t_1);
11071 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11072 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
11073 __Pyx_GOTREF(__pyx_t_6);
11074 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11075 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11076 __PYX_ERR(1, 497, __pyx_L5_except_error)
11078 goto __pyx_L5_except_error;
11079 __pyx_L5_except_error:;
11088 __Pyx_XGIVEREF(__pyx_t_2);
11089 __Pyx_XGIVEREF(__pyx_t_3);
11090 __Pyx_XGIVEREF(__pyx_t_4);
11091 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11092 goto __pyx_L1_error;
11093 __pyx_L6_except_return:;
11094 __Pyx_XGIVEREF(__pyx_t_2);
11095 __Pyx_XGIVEREF(__pyx_t_3);
11096 __Pyx_XGIVEREF(__pyx_t_4);
11097 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11111 __Pyx_XDECREF(__pyx_t_1);
11112 __Pyx_XDECREF(__pyx_t_5);
11113 __Pyx_XDECREF(__pyx_t_6);
11114 __Pyx_XDECREF(__pyx_t_7);
11115 __Pyx_XDECREF(__pyx_t_9);
11116 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11119 __Pyx_XDECREF(__pyx_v_struct);
11120 __Pyx_XDECREF(__pyx_v_bytesitem);
11121 __Pyx_XDECREF(__pyx_v_result);
11122 __Pyx_XGIVEREF(__pyx_r);
11123 __Pyx_TraceReturn(__pyx_r, 0);
11124 __Pyx_RefNannyFinishContext();
11136 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11137 PyObject *__pyx_v_struct = NULL;
11139 PyObject *__pyx_v_bytesvalue = 0;
11140 Py_ssize_t __pyx_v_i;
11141 PyObject *__pyx_r = NULL;
11142 __Pyx_TraceDeclarations
11143 __Pyx_RefNannyDeclarations
11144 PyObject *__pyx_t_1 = NULL;
11147 PyObject *__pyx_t_4 = NULL;
11148 PyObject *__pyx_t_5 = NULL;
11149 PyObject *__pyx_t_6 = NULL;
11151 PyObject *__pyx_t_8 = NULL;
11152 Py_ssize_t __pyx_t_9;
11153 PyObject *__pyx_t_10 = NULL;
11158 int __pyx_lineno = 0;
11159 const char *__pyx_filename = NULL;
11160 int __pyx_clineno = 0;
11161 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11162 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
11171 __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
11172 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
11173 __Pyx_GOTREF(__pyx_t_1);
11174 __pyx_v_struct = __pyx_t_1;
11184 __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
11185 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11186 __pyx_t_3 = (__pyx_t_2 != 0);
11196 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11197 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11198 __Pyx_GOTREF(__pyx_t_1);
11199 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11200 __Pyx_GOTREF(__pyx_t_4);
11201 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
11202 __Pyx_GOTREF(__pyx_t_5);
11203 __Pyx_GIVEREF(__pyx_t_4);
11204 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11206 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11207 __Pyx_GOTREF(__pyx_t_4);
11208 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11209 __Pyx_GOTREF(__pyx_t_6);
11210 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11211 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11212 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11213 __Pyx_GOTREF(__pyx_t_4);
11214 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11215 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11216 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11217 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11237 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11239 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
11240 __Pyx_GOTREF(__pyx_t_6);
11241 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
11242 __Pyx_GOTREF(__pyx_t_1);
11245 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11246 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11247 if (likely(__pyx_t_5)) {
11248 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
11249 __Pyx_INCREF(__pyx_t_5);
11250 __Pyx_INCREF(
function);
11251 __Pyx_DECREF_SET(__pyx_t_6,
function);
11255 #if CYTHON_FAST_PYCALL
11256 if (PyFunction_Check(__pyx_t_6)) {
11257 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11258 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11259 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11260 __Pyx_GOTREF(__pyx_t_4);
11261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11264 #if CYTHON_FAST_PYCCALL
11265 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11266 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11267 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11268 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11269 __Pyx_GOTREF(__pyx_t_4);
11270 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
11275 __Pyx_GOTREF(__pyx_t_8);
11277 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11279 __Pyx_GIVEREF(__pyx_t_1);
11280 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11281 __Pyx_INCREF(__pyx_v_value);
11282 __Pyx_GIVEREF(__pyx_v_value);
11283 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11285 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
11286 __Pyx_GOTREF(__pyx_t_4);
11287 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11289 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11290 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
11291 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11303 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11305 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11306 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
11307 __PYX_ERR(1, 516, __pyx_L1_error)
11309 __Pyx_INCREF(__pyx_v_bytesvalue);
11310 __pyx_t_10 = __pyx_v_bytesvalue;
11311 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11312 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11313 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11314 __pyx_t_11 = __pyx_t_14;
11315 __pyx_v_c = (__pyx_t_11[0]);
11324 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
11325 __pyx_v_i = __pyx_t_9;
11334 __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
11335 __pyx_t_9 = (__pyx_t_9 + 1);
11344 __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
11345 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11347 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11358 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11361 __Pyx_XDECREF(__pyx_t_1);
11362 __Pyx_XDECREF(__pyx_t_4);
11363 __Pyx_XDECREF(__pyx_t_5);
11364 __Pyx_XDECREF(__pyx_t_6);
11365 __Pyx_XDECREF(__pyx_t_8);
11366 __Pyx_XDECREF(__pyx_t_10);
11367 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11370 __Pyx_XDECREF(__pyx_v_struct);
11371 __Pyx_XDECREF(__pyx_v_bytesvalue);
11372 __Pyx_XGIVEREF(__pyx_r);
11373 __Pyx_TraceReturn(__pyx_r, 0);
11374 __Pyx_RefNannyFinishContext();
11387 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
11388 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11390 __Pyx_RefNannyDeclarations
11391 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
11392 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
11395 __Pyx_RefNannyFinishContext();
11399 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11401 __Pyx_TraceDeclarations
11402 __Pyx_RefNannyDeclarations
11405 PyObject *__pyx_t_3 = NULL;
11406 Py_ssize_t *__pyx_t_4;
11410 Py_ssize_t __pyx_t_8;
11411 int __pyx_lineno = 0;
11412 const char *__pyx_filename = NULL;
11413 int __pyx_clineno = 0;
11414 if (__pyx_v_info == NULL) {
11415 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
11418 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
11419 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11420 __Pyx_GIVEREF(__pyx_v_info->obj);
11421 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
11430 __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
11431 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11434 __pyx_t_1 = __pyx_t_2;
11435 goto __pyx_L4_bool_binop_done;
11437 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11438 __pyx_t_1 = __pyx_t_2;
11439 __pyx_L4_bool_binop_done:;
11440 if (unlikely(__pyx_t_1)) {
11449 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
11450 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
11451 __Pyx_GOTREF(__pyx_t_3);
11452 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11453 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11454 __PYX_ERR(1, 522, __pyx_L1_error)
11472 __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
11473 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11483 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
11484 __pyx_t_4 = __pyx_v_self->view.shape;
11485 __pyx_v_info->shape = __pyx_t_4;
11504 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
11506 __pyx_v_info->shape = NULL;
11517 __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
11518 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11528 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
11529 __pyx_t_4 = __pyx_v_self->view.strides;
11530 __pyx_v_info->strides = __pyx_t_4;
11549 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
11551 __pyx_v_info->strides = NULL;
11562 __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
11563 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11573 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
11574 __pyx_t_4 = __pyx_v_self->view.suboffsets;
11575 __pyx_v_info->suboffsets = __pyx_t_4;
11594 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
11596 __pyx_v_info->suboffsets = NULL;
11607 __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
11608 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11618 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
11619 __pyx_t_5 = __pyx_v_self->view.format;
11620 __pyx_v_info->format = __pyx_t_5;
11639 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
11641 __pyx_v_info->format = NULL;
11652 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
11653 __pyx_t_6 = __pyx_v_self->view.buf;
11654 __pyx_v_info->buf = __pyx_t_6;
11663 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
11664 __pyx_t_7 = __pyx_v_self->view.ndim;
11665 __pyx_v_info->ndim = __pyx_t_7;
11674 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
11675 __pyx_t_8 = __pyx_v_self->view.itemsize;
11676 __pyx_v_info->itemsize = __pyx_t_8;
11685 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
11686 __pyx_t_8 = __pyx_v_self->view.len;
11687 __pyx_v_info->len = __pyx_t_8;
11696 __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
11697 __pyx_t_1 = __pyx_v_self->view.readonly;
11698 __pyx_v_info->readonly = __pyx_t_1;
11707 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
11708 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11709 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11710 __Pyx_GOTREF(__pyx_v_info->obj);
11711 __Pyx_DECREF(__pyx_v_info->obj);
11712 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11726 __Pyx_XDECREF(__pyx_t_3);
11727 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11729 if (__pyx_v_info->obj != NULL) {
11730 __Pyx_GOTREF(__pyx_v_info->obj);
11731 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11735 if (__pyx_v_info->obj == Py_None) {
11736 __Pyx_GOTREF(__pyx_v_info->obj);
11737 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11740 __Pyx_TraceReturn(Py_None, 0);
11741 __Pyx_RefNannyFinishContext();
11754 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
11755 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11756 PyObject *__pyx_r = 0;
11757 __Pyx_RefNannyDeclarations
11758 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11759 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11762 __Pyx_RefNannyFinishContext();
11766 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11767 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11768 PyObject *__pyx_r = NULL;
11769 __Pyx_TraceDeclarations
11770 __Pyx_RefNannyDeclarations
11771 PyObject *__pyx_t_1 = NULL;
11773 int __pyx_lineno = 0;
11774 const char *__pyx_filename = NULL;
11775 int __pyx_clineno = 0;
11776 __Pyx_RefNannySetupContext(
"__get__", 0);
11777 __Pyx_TraceCall(
"__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
11786 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
11787 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
11788 __Pyx_GOTREF(__pyx_t_1);
11789 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
11790 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11800 __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
11801 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
11810 __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
11811 __Pyx_XDECREF(__pyx_r);
11812 __Pyx_INCREF(((PyObject *)__pyx_v_result));
11813 __pyx_r = ((PyObject *)__pyx_v_result);
11826 __Pyx_XDECREF(__pyx_t_1);
11827 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11830 __Pyx_XDECREF((PyObject *)__pyx_v_result);
11831 __Pyx_XGIVEREF(__pyx_r);
11832 __Pyx_TraceReturn(__pyx_r, 0);
11833 __Pyx_RefNannyFinishContext();
11846 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
11847 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11848 PyObject *__pyx_r = 0;
11849 __Pyx_RefNannyDeclarations
11850 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11851 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11854 __Pyx_RefNannyFinishContext();
11858 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11859 PyObject *__pyx_r = NULL;
11860 __Pyx_TraceDeclarations
11861 __Pyx_RefNannyDeclarations
11862 int __pyx_lineno = 0;
11863 const char *__pyx_filename = NULL;
11864 int __pyx_clineno = 0;
11865 __Pyx_RefNannySetupContext(
"__get__", 0);
11866 __Pyx_TraceCall(
"__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
11875 __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
11876 __Pyx_XDECREF(__pyx_r);
11877 __Pyx_INCREF(__pyx_v_self->obj);
11878 __pyx_r = __pyx_v_self->obj;
11891 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11894 __Pyx_XGIVEREF(__pyx_r);
11895 __Pyx_TraceReturn(__pyx_r, 0);
11896 __Pyx_RefNannyFinishContext();
11909 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
11910 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11911 PyObject *__pyx_r = 0;
11912 __Pyx_RefNannyDeclarations
11913 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11914 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
11917 __Pyx_RefNannyFinishContext();
11921 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
11922 Py_ssize_t __pyx_v_length;
11923 PyObject *__pyx_r = NULL;
11924 __Pyx_TraceDeclarations
11925 __Pyx_RefNannyDeclarations
11926 PyObject *__pyx_t_1 = NULL;
11927 Py_ssize_t *__pyx_t_2;
11928 Py_ssize_t *__pyx_t_3;
11929 Py_ssize_t *__pyx_t_4;
11930 PyObject *__pyx_t_5 = NULL;
11931 int __pyx_lineno = 0;
11932 const char *__pyx_filename = NULL;
11933 int __pyx_clineno = 0;
11934 __Pyx_RefNannySetupContext(
"__get__", 0);
11935 __Pyx_TraceCall(
"__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
11944 __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
11945 __Pyx_XDECREF(__pyx_r);
11946 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
11947 __Pyx_GOTREF(__pyx_t_1);
11948 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11949 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11950 __pyx_t_2 = __pyx_t_4;
11951 __pyx_v_length = (__pyx_t_2[0]);
11952 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
11953 __Pyx_GOTREF(__pyx_t_5);
11954 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
11955 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11957 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
11958 __Pyx_GOTREF(__pyx_t_5);
11959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11960 __pyx_r = __pyx_t_5;
11974 __Pyx_XDECREF(__pyx_t_1);
11975 __Pyx_XDECREF(__pyx_t_5);
11976 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11979 __Pyx_XGIVEREF(__pyx_r);
11980 __Pyx_TraceReturn(__pyx_r, 0);
11981 __Pyx_RefNannyFinishContext();
11994 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
11995 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11996 PyObject *__pyx_r = 0;
11997 __Pyx_RefNannyDeclarations
11998 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
11999 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12002 __Pyx_RefNannyFinishContext();
12006 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12007 Py_ssize_t __pyx_v_stride;
12008 PyObject *__pyx_r = NULL;
12009 __Pyx_TraceDeclarations
12010 __Pyx_RefNannyDeclarations
12012 PyObject *__pyx_t_2 = NULL;
12013 Py_ssize_t *__pyx_t_3;
12014 Py_ssize_t *__pyx_t_4;
12015 Py_ssize_t *__pyx_t_5;
12016 PyObject *__pyx_t_6 = NULL;
12017 int __pyx_lineno = 0;
12018 const char *__pyx_filename = NULL;
12019 int __pyx_clineno = 0;
12020 __Pyx_RefNannySetupContext(
"__get__", 0);
12021 __Pyx_TraceCall(
"__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
12030 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12031 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12032 if (unlikely(__pyx_t_1)) {
12041 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12042 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12043 __Pyx_GOTREF(__pyx_t_2);
12044 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12045 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12046 __PYX_ERR(1, 572, __pyx_L1_error)
12064 __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
12065 __Pyx_XDECREF(__pyx_r);
12066 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
12067 __Pyx_GOTREF(__pyx_t_2);
12068 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12069 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12070 __pyx_t_3 = __pyx_t_5;
12071 __pyx_v_stride = (__pyx_t_3[0]);
12072 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12073 __Pyx_GOTREF(__pyx_t_6);
12074 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
12075 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12077 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
12078 __Pyx_GOTREF(__pyx_t_6);
12079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12080 __pyx_r = __pyx_t_6;
12094 __Pyx_XDECREF(__pyx_t_2);
12095 __Pyx_XDECREF(__pyx_t_6);
12096 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12099 __Pyx_XGIVEREF(__pyx_r);
12100 __Pyx_TraceReturn(__pyx_r, 0);
12101 __Pyx_RefNannyFinishContext();
12114 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12115 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12116 PyObject *__pyx_r = 0;
12117 __Pyx_RefNannyDeclarations
12118 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12119 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12122 __Pyx_RefNannyFinishContext();
12126 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12127 Py_ssize_t __pyx_v_suboffset;
12128 PyObject *__pyx_r = NULL;
12129 __Pyx_TraceDeclarations
12130 __Pyx_RefNannyDeclarations
12132 PyObject *__pyx_t_2 = NULL;
12133 PyObject *__pyx_t_3 = NULL;
12134 Py_ssize_t *__pyx_t_4;
12135 Py_ssize_t *__pyx_t_5;
12136 Py_ssize_t *__pyx_t_6;
12137 int __pyx_lineno = 0;
12138 const char *__pyx_filename = NULL;
12139 int __pyx_clineno = 0;
12140 __Pyx_RefNannySetupContext(
"__get__", 0);
12141 __Pyx_TraceCall(
"__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
12150 __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
12151 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12161 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12162 __Pyx_XDECREF(__pyx_r);
12163 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12164 __Pyx_GOTREF(__pyx_t_2);
12165 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12166 __Pyx_GOTREF(__pyx_t_3);
12167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12168 __pyx_r = __pyx_t_3;
12188 __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
12189 __Pyx_XDECREF(__pyx_r);
12190 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
12191 __Pyx_GOTREF(__pyx_t_3);
12192 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12193 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12194 __pyx_t_4 = __pyx_t_6;
12195 __pyx_v_suboffset = (__pyx_t_4[0]);
12196 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12197 __Pyx_GOTREF(__pyx_t_2);
12198 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
12199 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12201 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
12202 __Pyx_GOTREF(__pyx_t_2);
12203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12204 __pyx_r = __pyx_t_2;
12218 __Pyx_XDECREF(__pyx_t_2);
12219 __Pyx_XDECREF(__pyx_t_3);
12220 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12223 __Pyx_XGIVEREF(__pyx_r);
12224 __Pyx_TraceReturn(__pyx_r, 0);
12225 __Pyx_RefNannyFinishContext();
12238 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
12239 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12240 PyObject *__pyx_r = 0;
12241 __Pyx_RefNannyDeclarations
12242 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12243 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12246 __Pyx_RefNannyFinishContext();
12250 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12251 PyObject *__pyx_r = NULL;
12252 __Pyx_TraceDeclarations
12253 __Pyx_RefNannyDeclarations
12254 PyObject *__pyx_t_1 = NULL;
12255 int __pyx_lineno = 0;
12256 const char *__pyx_filename = NULL;
12257 int __pyx_clineno = 0;
12258 __Pyx_RefNannySetupContext(
"__get__", 0);
12259 __Pyx_TraceCall(
"__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
12268 __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
12269 __Pyx_XDECREF(__pyx_r);
12270 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
12271 __Pyx_GOTREF(__pyx_t_1);
12272 __pyx_r = __pyx_t_1;
12286 __Pyx_XDECREF(__pyx_t_1);
12287 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12290 __Pyx_XGIVEREF(__pyx_r);
12291 __Pyx_TraceReturn(__pyx_r, 0);
12292 __Pyx_RefNannyFinishContext();
12305 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
12306 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12307 PyObject *__pyx_r = 0;
12308 __Pyx_RefNannyDeclarations
12309 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12310 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12313 __Pyx_RefNannyFinishContext();
12317 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12318 PyObject *__pyx_r = NULL;
12319 __Pyx_TraceDeclarations
12320 __Pyx_RefNannyDeclarations
12321 PyObject *__pyx_t_1 = NULL;
12322 int __pyx_lineno = 0;
12323 const char *__pyx_filename = NULL;
12324 int __pyx_clineno = 0;
12325 __Pyx_RefNannySetupContext(
"__get__", 0);
12326 __Pyx_TraceCall(
"__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
12335 __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
12336 __Pyx_XDECREF(__pyx_r);
12337 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
12338 __Pyx_GOTREF(__pyx_t_1);
12339 __pyx_r = __pyx_t_1;
12353 __Pyx_XDECREF(__pyx_t_1);
12354 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12357 __Pyx_XGIVEREF(__pyx_r);
12358 __Pyx_TraceReturn(__pyx_r, 0);
12359 __Pyx_RefNannyFinishContext();
12372 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
12373 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12374 PyObject *__pyx_r = 0;
12375 __Pyx_RefNannyDeclarations
12376 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12377 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12380 __Pyx_RefNannyFinishContext();
12384 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12385 PyObject *__pyx_r = NULL;
12386 __Pyx_TraceDeclarations
12387 __Pyx_RefNannyDeclarations
12388 PyObject *__pyx_t_1 = NULL;
12389 PyObject *__pyx_t_2 = NULL;
12390 PyObject *__pyx_t_3 = NULL;
12391 int __pyx_lineno = 0;
12392 const char *__pyx_filename = NULL;
12393 int __pyx_clineno = 0;
12394 __Pyx_RefNannySetupContext(
"__get__", 0);
12395 __Pyx_TraceCall(
"__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
12404 __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
12405 __Pyx_XDECREF(__pyx_r);
12406 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
12407 __Pyx_GOTREF(__pyx_t_1);
12408 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
12409 __Pyx_GOTREF(__pyx_t_2);
12410 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
12411 __Pyx_GOTREF(__pyx_t_3);
12412 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12413 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12414 __pyx_r = __pyx_t_3;
12428 __Pyx_XDECREF(__pyx_t_1);
12429 __Pyx_XDECREF(__pyx_t_2);
12430 __Pyx_XDECREF(__pyx_t_3);
12431 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12434 __Pyx_XGIVEREF(__pyx_r);
12435 __Pyx_TraceReturn(__pyx_r, 0);
12436 __Pyx_RefNannyFinishContext();
12449 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
12450 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12451 PyObject *__pyx_r = 0;
12452 __Pyx_RefNannyDeclarations
12453 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12454 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12457 __Pyx_RefNannyFinishContext();
12461 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12462 PyObject *__pyx_v_result = NULL;
12463 PyObject *__pyx_v_length = NULL;
12464 PyObject *__pyx_r = NULL;
12465 __Pyx_TraceDeclarations
12466 __Pyx_RefNannyDeclarations
12469 Py_ssize_t *__pyx_t_3;
12470 Py_ssize_t *__pyx_t_4;
12471 Py_ssize_t *__pyx_t_5;
12472 PyObject *__pyx_t_6 = NULL;
12473 int __pyx_lineno = 0;
12474 const char *__pyx_filename = NULL;
12475 int __pyx_clineno = 0;
12476 __Pyx_RefNannySetupContext(
"__get__", 0);
12477 __Pyx_TraceCall(
"__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
12486 __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
12487 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12488 __pyx_t_2 = (__pyx_t_1 != 0);
12498 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
12499 __Pyx_INCREF(__pyx_int_1);
12500 __pyx_v_result = __pyx_int_1;
12509 __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
12510 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12511 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12512 __pyx_t_3 = __pyx_t_5;
12513 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
12514 __Pyx_GOTREF(__pyx_t_6);
12515 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12525 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
12526 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
12527 __Pyx_GOTREF(__pyx_t_6);
12528 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12539 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
12540 __Pyx_INCREF(__pyx_v_result);
12541 __Pyx_GIVEREF(__pyx_v_result);
12542 __Pyx_GOTREF(__pyx_v_self->_size);
12543 __Pyx_DECREF(__pyx_v_self->_size);
12544 __pyx_v_self->_size = __pyx_v_result;
12562 __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
12563 __Pyx_XDECREF(__pyx_r);
12564 __Pyx_INCREF(__pyx_v_self->_size);
12565 __pyx_r = __pyx_v_self->_size;
12578 __Pyx_XDECREF(__pyx_t_6);
12579 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12582 __Pyx_XDECREF(__pyx_v_result);
12583 __Pyx_XDECREF(__pyx_v_length);
12584 __Pyx_XGIVEREF(__pyx_r);
12585 __Pyx_TraceReturn(__pyx_r, 0);
12586 __Pyx_RefNannyFinishContext();
12599 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
12600 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12601 Py_ssize_t __pyx_r;
12602 __Pyx_RefNannyDeclarations
12603 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
12604 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12607 __Pyx_RefNannyFinishContext();
12611 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12612 Py_ssize_t __pyx_r;
12613 __Pyx_TraceDeclarations
12614 __Pyx_RefNannyDeclarations
12616 int __pyx_lineno = 0;
12617 const char *__pyx_filename = NULL;
12618 int __pyx_clineno = 0;
12619 __Pyx_RefNannySetupContext(
"__len__", 0);
12620 __Pyx_TraceCall(
"__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
12629 __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
12630 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12640 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
12641 __pyx_r = (__pyx_v_self->view.shape[0]);
12660 __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
12674 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12677 __Pyx_TraceReturn(Py_None, 0);
12678 __Pyx_RefNannyFinishContext();
12691 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
12692 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12693 PyObject *__pyx_r = 0;
12694 __Pyx_RefNannyDeclarations
12695 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
12696 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12699 __Pyx_RefNannyFinishContext();
12703 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12704 PyObject *__pyx_r = NULL;
12705 __Pyx_TraceDeclarations
12706 __Pyx_RefNannyDeclarations
12707 PyObject *__pyx_t_1 = NULL;
12708 PyObject *__pyx_t_2 = NULL;
12709 PyObject *__pyx_t_3 = NULL;
12710 int __pyx_lineno = 0;
12711 const char *__pyx_filename = NULL;
12712 int __pyx_clineno = 0;
12713 __Pyx_RefNannySetupContext(
"__repr__", 0);
12714 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
12723 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
12724 __Pyx_XDECREF(__pyx_r);
12725 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
12726 __Pyx_GOTREF(__pyx_t_1);
12727 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
12728 __Pyx_GOTREF(__pyx_t_2);
12729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12730 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
12731 __Pyx_GOTREF(__pyx_t_1);
12732 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12741 __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
12742 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
12743 __Pyx_GOTREF(__pyx_t_2);
12752 __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
12753 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
12754 __Pyx_GOTREF(__pyx_t_3);
12755 __Pyx_GIVEREF(__pyx_t_1);
12756 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12757 __Pyx_GIVEREF(__pyx_t_2);
12758 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12761 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
12762 __Pyx_GOTREF(__pyx_t_2);
12763 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12764 __pyx_r = __pyx_t_2;
12778 __Pyx_XDECREF(__pyx_t_1);
12779 __Pyx_XDECREF(__pyx_t_2);
12780 __Pyx_XDECREF(__pyx_t_3);
12781 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12784 __Pyx_XGIVEREF(__pyx_r);
12785 __Pyx_TraceReturn(__pyx_r, 0);
12786 __Pyx_RefNannyFinishContext();
12799 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
12800 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12801 PyObject *__pyx_r = 0;
12802 __Pyx_RefNannyDeclarations
12803 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
12804 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12807 __Pyx_RefNannyFinishContext();
12811 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12812 PyObject *__pyx_r = NULL;
12813 __Pyx_TraceDeclarations
12814 __Pyx_RefNannyDeclarations
12815 PyObject *__pyx_t_1 = NULL;
12816 PyObject *__pyx_t_2 = NULL;
12817 int __pyx_lineno = 0;
12818 const char *__pyx_filename = NULL;
12819 int __pyx_clineno = 0;
12820 __Pyx_RefNannySetupContext(
"__str__", 0);
12821 __Pyx_TraceCall(
"__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
12830 __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
12831 __Pyx_XDECREF(__pyx_r);
12832 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12833 __Pyx_GOTREF(__pyx_t_1);
12834 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12835 __Pyx_GOTREF(__pyx_t_2);
12836 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12837 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12838 __Pyx_GOTREF(__pyx_t_1);
12839 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12840 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12841 __Pyx_GOTREF(__pyx_t_2);
12842 __Pyx_GIVEREF(__pyx_t_1);
12843 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12845 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
12846 __Pyx_GOTREF(__pyx_t_1);
12847 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12848 __pyx_r = __pyx_t_1;
12862 __Pyx_XDECREF(__pyx_t_1);
12863 __Pyx_XDECREF(__pyx_t_2);
12864 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12867 __Pyx_XGIVEREF(__pyx_r);
12868 __Pyx_TraceReturn(__pyx_r, 0);
12869 __Pyx_RefNannyFinishContext();
12882 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12883 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
12884 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12885 PyObject *__pyx_r = 0;
12886 __Pyx_RefNannyDeclarations
12887 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
12888 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12891 __Pyx_RefNannyFinishContext();
12895 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
12896 __Pyx_memviewslice *__pyx_v_mslice;
12897 __Pyx_memviewslice __pyx_v_tmp;
12898 PyObject *__pyx_r = NULL;
12899 __Pyx_TraceDeclarations
12900 __Pyx_RefNannyDeclarations
12901 __Pyx_memviewslice *__pyx_t_1;
12902 PyObject *__pyx_t_2 = NULL;
12903 int __pyx_lineno = 0;
12904 const char *__pyx_filename = NULL;
12905 int __pyx_clineno = 0;
12906 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
12907 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
12916 __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
12917 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
12918 __pyx_v_mslice = __pyx_t_1;
12927 __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
12928 __Pyx_XDECREF(__pyx_r);
12929 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
12930 __Pyx_GOTREF(__pyx_t_2);
12931 __pyx_r = __pyx_t_2;
12945 __Pyx_XDECREF(__pyx_t_2);
12946 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12949 __Pyx_XGIVEREF(__pyx_r);
12950 __Pyx_TraceReturn(__pyx_r, 0);
12951 __Pyx_RefNannyFinishContext();
12964 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
12965 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
12966 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12967 PyObject *__pyx_r = 0;
12968 __Pyx_RefNannyDeclarations
12969 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
12970 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12973 __Pyx_RefNannyFinishContext();
12977 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
12978 __Pyx_memviewslice *__pyx_v_mslice;
12979 __Pyx_memviewslice __pyx_v_tmp;
12980 PyObject *__pyx_r = NULL;
12981 __Pyx_TraceDeclarations
12982 __Pyx_RefNannyDeclarations
12983 __Pyx_memviewslice *__pyx_t_1;
12984 PyObject *__pyx_t_2 = NULL;
12985 int __pyx_lineno = 0;
12986 const char *__pyx_filename = NULL;
12987 int __pyx_clineno = 0;
12988 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
12989 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
12998 __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
12999 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
13000 __pyx_v_mslice = __pyx_t_1;
13009 __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
13010 __Pyx_XDECREF(__pyx_r);
13011 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
13012 __Pyx_GOTREF(__pyx_t_2);
13013 __pyx_r = __pyx_t_2;
13027 __Pyx_XDECREF(__pyx_t_2);
13028 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13031 __Pyx_XGIVEREF(__pyx_r);
13032 __Pyx_TraceReturn(__pyx_r, 0);
13033 __Pyx_RefNannyFinishContext();
13046 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13047 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13048 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13049 PyObject *__pyx_r = 0;
13050 __Pyx_RefNannyDeclarations
13051 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13052 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13055 __Pyx_RefNannyFinishContext();
13059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13060 __Pyx_memviewslice __pyx_v_mslice;
13062 PyObject *__pyx_r = NULL;
13063 __Pyx_TraceDeclarations
13064 __Pyx_RefNannyDeclarations
13065 __Pyx_memviewslice __pyx_t_1;
13066 PyObject *__pyx_t_2 = NULL;
13067 int __pyx_lineno = 0;
13068 const char *__pyx_filename = NULL;
13069 int __pyx_clineno = 0;
13070 __Pyx_RefNannySetupContext(
"copy", 0);
13071 __Pyx_TraceCall(
"copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
13080 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13081 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13090 __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
13091 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13100 __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
13101 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
13102 __pyx_v_mslice = __pyx_t_1;
13111 __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
13112 __Pyx_XDECREF(__pyx_r);
13113 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
13114 __Pyx_GOTREF(__pyx_t_2);
13115 __pyx_r = __pyx_t_2;
13129 __Pyx_XDECREF(__pyx_t_2);
13130 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13133 __Pyx_XGIVEREF(__pyx_r);
13134 __Pyx_TraceReturn(__pyx_r, 0);
13135 __Pyx_RefNannyFinishContext();
13148 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13149 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13150 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13151 PyObject *__pyx_r = 0;
13152 __Pyx_RefNannyDeclarations
13153 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13154 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13157 __Pyx_RefNannyFinishContext();
13161 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13162 __Pyx_memviewslice __pyx_v_src;
13163 __Pyx_memviewslice __pyx_v_dst;
13165 PyObject *__pyx_r = NULL;
13166 __Pyx_TraceDeclarations
13167 __Pyx_RefNannyDeclarations
13168 __Pyx_memviewslice __pyx_t_1;
13169 PyObject *__pyx_t_2 = NULL;
13170 int __pyx_lineno = 0;
13171 const char *__pyx_filename = NULL;
13172 int __pyx_clineno = 0;
13173 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13174 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
13183 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13184 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13193 __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
13194 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13203 __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
13204 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
13205 __pyx_v_dst = __pyx_t_1;
13214 __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
13215 __Pyx_XDECREF(__pyx_r);
13216 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
13217 __Pyx_GOTREF(__pyx_t_2);
13218 __pyx_r = __pyx_t_2;
13232 __Pyx_XDECREF(__pyx_t_2);
13233 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13236 __Pyx_XGIVEREF(__pyx_r);
13237 __Pyx_TraceReturn(__pyx_r, 0);
13238 __Pyx_RefNannyFinishContext();
13249 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13250 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13251 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13252 PyObject *__pyx_r = 0;
13253 __Pyx_RefNannyDeclarations
13254 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13255 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13258 __Pyx_RefNannyFinishContext();
13262 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
13263 PyObject *__pyx_r = NULL;
13264 __Pyx_TraceDeclarations
13265 __Pyx_RefNannyDeclarations
13266 PyObject *__pyx_t_1 = NULL;
13267 int __pyx_lineno = 0;
13268 const char *__pyx_filename = NULL;
13269 int __pyx_clineno = 0;
13270 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13271 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13279 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13280 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13281 __Pyx_GOTREF(__pyx_t_1);
13282 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13284 __PYX_ERR(1, 2, __pyx_L1_error)
13294 __Pyx_XDECREF(__pyx_t_1);
13295 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13297 __Pyx_XGIVEREF(__pyx_r);
13298 __Pyx_TraceReturn(__pyx_r, 0);
13299 __Pyx_RefNannyFinishContext();
13311 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13312 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13313 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13314 PyObject *__pyx_r = 0;
13315 __Pyx_RefNannyDeclarations
13316 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13317 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13320 __Pyx_RefNannyFinishContext();
13324 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13325 PyObject *__pyx_r = NULL;
13326 __Pyx_TraceDeclarations
13327 __Pyx_RefNannyDeclarations
13328 PyObject *__pyx_t_1 = NULL;
13329 int __pyx_lineno = 0;
13330 const char *__pyx_filename = NULL;
13331 int __pyx_clineno = 0;
13332 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13333 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13340 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13341 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13342 __Pyx_GOTREF(__pyx_t_1);
13343 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13345 __PYX_ERR(1, 4, __pyx_L1_error)
13356 __Pyx_XDECREF(__pyx_t_1);
13357 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13359 __Pyx_XGIVEREF(__pyx_r);
13360 __Pyx_TraceReturn(__pyx_r, 0);
13361 __Pyx_RefNannyFinishContext();
13373 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13374 struct __pyx_memoryview_obj *__pyx_v_result = 0;
13375 PyObject *__pyx_r = NULL;
13376 __Pyx_TraceDeclarations
13377 __Pyx_RefNannyDeclarations
13378 PyObject *__pyx_t_1 = NULL;
13379 PyObject *__pyx_t_2 = NULL;
13380 PyObject *__pyx_t_3 = NULL;
13381 int __pyx_lineno = 0;
13382 const char *__pyx_filename = NULL;
13383 int __pyx_clineno = 0;
13384 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
13385 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
13394 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
13395 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
13396 __Pyx_GOTREF(__pyx_t_1);
13397 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
13398 __Pyx_GOTREF(__pyx_t_2);
13399 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
13400 __Pyx_GOTREF(__pyx_t_3);
13401 __Pyx_INCREF(__pyx_v_o);
13402 __Pyx_GIVEREF(__pyx_v_o);
13403 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13404 __Pyx_GIVEREF(__pyx_t_1);
13405 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13406 __Pyx_GIVEREF(__pyx_t_2);
13407 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13410 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
13411 __Pyx_GOTREF(__pyx_t_2);
13412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13413 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13423 __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
13424 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13433 __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
13434 __Pyx_XDECREF(__pyx_r);
13435 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13436 __pyx_r = ((PyObject *)__pyx_v_result);
13449 __Pyx_XDECREF(__pyx_t_1);
13450 __Pyx_XDECREF(__pyx_t_2);
13451 __Pyx_XDECREF(__pyx_t_3);
13452 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13455 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13456 __Pyx_XGIVEREF(__pyx_r);
13457 __Pyx_TraceReturn(__pyx_r, 0);
13458 __Pyx_RefNannyFinishContext();
13470 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13472 __Pyx_TraceDeclarations
13473 __Pyx_RefNannyDeclarations
13475 int __pyx_lineno = 0;
13476 const char *__pyx_filename = NULL;
13477 int __pyx_clineno = 0;
13478 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
13479 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
13488 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
13489 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13490 __pyx_r = __pyx_t_1;
13503 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13506 __Pyx_TraceReturn(Py_None, 0);
13507 __Pyx_RefNannyFinishContext();
13519 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13520 PyObject *__pyx_v_tup = NULL;
13521 PyObject *__pyx_v_result = NULL;
13522 int __pyx_v_have_slices;
13523 int __pyx_v_seen_ellipsis;
13524 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13525 PyObject *__pyx_v_item = NULL;
13526 Py_ssize_t __pyx_v_nslices;
13527 PyObject *__pyx_r = NULL;
13528 __Pyx_TraceDeclarations
13529 __Pyx_RefNannyDeclarations
13532 PyObject *__pyx_t_3 = NULL;
13533 PyObject *__pyx_t_4 = NULL;
13534 Py_ssize_t __pyx_t_5;
13535 PyObject *(*__pyx_t_6)(PyObject *);
13536 PyObject *__pyx_t_7 = NULL;
13537 Py_ssize_t __pyx_t_8;
13540 PyObject *__pyx_t_11 = NULL;
13541 int __pyx_lineno = 0;
13542 const char *__pyx_filename = NULL;
13543 int __pyx_clineno = 0;
13544 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
13545 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
13554 __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
13555 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13556 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13566 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
13567 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
13568 __Pyx_GOTREF(__pyx_t_3);
13569 __Pyx_INCREF(__pyx_v_index);
13570 __Pyx_GIVEREF(__pyx_v_index);
13571 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13572 __pyx_v_tup = __pyx_t_3;
13592 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
13594 __Pyx_INCREF(__pyx_v_index);
13595 __pyx_v_tup = __pyx_v_index;
13606 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
13607 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
13608 __Pyx_GOTREF(__pyx_t_3);
13609 __pyx_v_result = ((PyObject*)__pyx_t_3);
13619 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
13620 __pyx_v_have_slices = 0;
13629 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
13630 __pyx_v_seen_ellipsis = 0;
13639 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
13640 __Pyx_INCREF(__pyx_int_0);
13641 __pyx_t_3 = __pyx_int_0;
13642 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13643 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13646 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
13647 __Pyx_GOTREF(__pyx_t_4);
13648 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
13651 if (likely(!__pyx_t_6)) {
13652 if (likely(PyList_CheckExact(__pyx_t_4))) {
13653 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
13654 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13655 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
13657 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13658 __Pyx_GOTREF(__pyx_t_7);
13661 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
13662 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13663 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
13665 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13666 __Pyx_GOTREF(__pyx_t_7);
13670 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13671 if (unlikely(!__pyx_t_7)) {
13672 PyObject* exc_type = PyErr_Occurred();
13674 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13675 else __PYX_ERR(1, 681, __pyx_L1_error)
13679 __Pyx_GOTREF(__pyx_t_7);
13681 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13683 __Pyx_INCREF(__pyx_t_3);
13684 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13685 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
13686 __Pyx_GOTREF(__pyx_t_7);
13687 __Pyx_DECREF(__pyx_t_3);
13688 __pyx_t_3 = __pyx_t_7;
13698 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
13699 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13700 __pyx_t_1 = (__pyx_t_2 != 0);
13710 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
13711 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13721 __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
13722 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
13723 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
13724 __Pyx_GOTREF(__pyx_t_7);
13725 { Py_ssize_t __pyx_temp;
13726 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13727 __Pyx_INCREF(__pyx_slice__32);
13728 __Pyx_GIVEREF(__pyx_slice__32);
13729 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
13732 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
13733 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13742 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
13743 __pyx_v_seen_ellipsis = 1;
13762 __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
13764 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
13775 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
13776 __pyx_v_have_slices = 1;
13795 __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
13797 __pyx_t_2 = PySlice_Check(__pyx_v_item);
13798 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13801 __pyx_t_1 = __pyx_t_10;
13802 goto __pyx_L9_bool_binop_done;
13804 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13805 __pyx_t_1 = __pyx_t_10;
13806 __pyx_L9_bool_binop_done:;
13807 if (unlikely(__pyx_t_1)) {
13816 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
13817 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
13818 __Pyx_GOTREF(__pyx_t_7);
13819 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
13820 __Pyx_GOTREF(__pyx_t_11);
13821 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13822 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13823 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13824 __PYX_ERR(1, 691, __pyx_L1_error)
13842 __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
13843 __pyx_t_10 = (__pyx_v_have_slices != 0);
13846 __pyx_t_1 = __pyx_t_10;
13847 goto __pyx_L11_bool_binop_done;
13849 __pyx_t_10 = PySlice_Check(__pyx_v_item);
13850 __pyx_t_2 = (__pyx_t_10 != 0);
13851 __pyx_t_1 = __pyx_t_2;
13852 __pyx_L11_bool_binop_done:;
13853 __pyx_v_have_slices = __pyx_t_1;
13862 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
13863 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
13874 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
13876 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13877 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13886 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
13887 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
13888 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13897 __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
13898 __pyx_t_1 = (__pyx_v_nslices != 0);
13908 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
13909 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
13910 __Pyx_GOTREF(__pyx_t_3);
13911 { Py_ssize_t __pyx_temp;
13912 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13913 __Pyx_INCREF(__pyx_slice__32);
13914 __Pyx_GIVEREF(__pyx_slice__32);
13915 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
13918 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
13919 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13937 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
13938 __Pyx_XDECREF(__pyx_r);
13939 if (!__pyx_v_have_slices) {
13941 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
13942 __Pyx_GOTREF(__pyx_t_4);
13943 __pyx_t_3 = __pyx_t_4;
13945 goto __pyx_L14_bool_binop_done;
13947 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
13948 __Pyx_GOTREF(__pyx_t_4);
13949 __pyx_t_3 = __pyx_t_4;
13951 __pyx_L14_bool_binop_done:;
13952 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
13953 __Pyx_GOTREF(__pyx_t_4);
13954 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
13955 __Pyx_GOTREF(__pyx_t_11);
13956 __Pyx_GIVEREF(__pyx_t_3);
13957 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13958 __Pyx_GIVEREF(__pyx_t_4);
13959 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13962 __pyx_r = ((PyObject*)__pyx_t_11);
13976 __Pyx_XDECREF(__pyx_t_3);
13977 __Pyx_XDECREF(__pyx_t_4);
13978 __Pyx_XDECREF(__pyx_t_7);
13979 __Pyx_XDECREF(__pyx_t_11);
13980 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13983 __Pyx_XDECREF(__pyx_v_tup);
13984 __Pyx_XDECREF(__pyx_v_result);
13985 __Pyx_XDECREF(__pyx_v_idx);
13986 __Pyx_XDECREF(__pyx_v_item);
13987 __Pyx_XGIVEREF(__pyx_r);
13988 __Pyx_TraceReturn(__pyx_r, 0);
13989 __Pyx_RefNannyFinishContext();
14001 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14002 Py_ssize_t __pyx_v_suboffset;
14003 PyObject *__pyx_r = NULL;
14004 __Pyx_TraceDeclarations
14005 __Pyx_RefNannyDeclarations
14006 Py_ssize_t *__pyx_t_1;
14007 Py_ssize_t *__pyx_t_2;
14008 Py_ssize_t *__pyx_t_3;
14010 PyObject *__pyx_t_5 = NULL;
14011 int __pyx_lineno = 0;
14012 const char *__pyx_filename = NULL;
14013 int __pyx_clineno = 0;
14014 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14015 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
14024 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14025 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14026 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14027 __pyx_t_1 = __pyx_t_3;
14028 __pyx_v_suboffset = (__pyx_t_1[0]);
14037 __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
14038 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14039 if (unlikely(__pyx_t_4)) {
14048 __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
14049 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
14050 __Pyx_GOTREF(__pyx_t_5);
14051 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14052 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14053 __PYX_ERR(1, 705, __pyx_L1_error)
14074 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14077 __Pyx_XDECREF(__pyx_t_5);
14078 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14081 __Pyx_XGIVEREF(__pyx_r);
14082 __Pyx_TraceReturn(__pyx_r, 0);
14083 __Pyx_RefNannyFinishContext();
14095 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14096 int __pyx_v_new_ndim;
14097 int __pyx_v_suboffset_dim;
14099 __Pyx_memviewslice __pyx_v_src;
14100 __Pyx_memviewslice __pyx_v_dst;
14101 __Pyx_memviewslice *__pyx_v_p_src;
14102 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14103 __Pyx_memviewslice *__pyx_v_p_dst;
14104 int *__pyx_v_p_suboffset_dim;
14105 Py_ssize_t __pyx_v_start;
14106 Py_ssize_t __pyx_v_stop;
14107 Py_ssize_t __pyx_v_step;
14108 int __pyx_v_have_start;
14109 int __pyx_v_have_stop;
14110 int __pyx_v_have_step;
14111 PyObject *__pyx_v_index = NULL;
14112 struct __pyx_memoryview_obj *__pyx_r = NULL;
14113 __Pyx_TraceDeclarations
14114 __Pyx_RefNannyDeclarations
14117 PyObject *__pyx_t_3 = NULL;
14118 struct __pyx_memoryview_obj *__pyx_t_4;
14121 Py_ssize_t __pyx_t_7;
14122 PyObject *(*__pyx_t_8)(PyObject *);
14123 PyObject *__pyx_t_9 = NULL;
14124 Py_ssize_t __pyx_t_10;
14126 Py_ssize_t __pyx_t_12;
14127 int __pyx_lineno = 0;
14128 const char *__pyx_filename = NULL;
14129 int __pyx_clineno = 0;
14130 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14131 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
14140 __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
14141 __pyx_v_new_ndim = 0;
14142 __pyx_v_suboffset_dim = -1;
14151 __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
14152 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14161 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14162 #ifndef CYTHON_WITHOUT_ASSERTIONS
14163 if (unlikely(__pyx_assertions_enabled())) {
14164 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14165 PyErr_SetNone(PyExc_AssertionError);
14166 __PYX_ERR(1, 724, __pyx_L1_error)
14178 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14179 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14180 __pyx_t_2 = (__pyx_t_1 != 0);
14190 __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
14191 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
14192 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14193 __Pyx_INCREF(__pyx_t_3);
14194 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14204 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14205 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14224 __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
14226 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14235 __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
14236 __pyx_v_p_src = (&__pyx_v_src);
14247 __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
14248 __pyx_t_4 = __pyx_v_p_src->memview;
14249 __pyx_v_dst.memview = __pyx_t_4;
14258 __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
14259 __pyx_t_5 = __pyx_v_p_src->data;
14260 __pyx_v_dst.data = __pyx_t_5;
14269 __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
14270 __pyx_v_p_dst = (&__pyx_v_dst);
14279 __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
14280 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14289 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14291 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14292 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14295 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
14296 __Pyx_GOTREF(__pyx_t_3);
14297 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
14300 if (likely(!__pyx_t_8)) {
14301 if (likely(PyList_CheckExact(__pyx_t_3))) {
14302 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
14303 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14304 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14306 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14307 __Pyx_GOTREF(__pyx_t_9);
14310 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
14311 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14312 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
14314 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
14315 __Pyx_GOTREF(__pyx_t_9);
14319 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14320 if (unlikely(!__pyx_t_9)) {
14321 PyObject* exc_type = PyErr_Occurred();
14323 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14324 else __PYX_ERR(1, 748, __pyx_L1_error)
14328 __Pyx_GOTREF(__pyx_t_9);
14330 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14332 __pyx_v_dim = __pyx_t_6;
14333 __pyx_t_6 = (__pyx_t_6 + 1);
14342 __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
14343 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14353 __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
14354 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
14363 __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
14364 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
14383 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
14384 __pyx_t_2 = (__pyx_v_index == Py_None);
14385 __pyx_t_1 = (__pyx_t_2 != 0);
14395 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
14396 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14405 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
14406 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14415 __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
14416 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14425 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
14426 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14445 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
14447 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14448 __Pyx_GOTREF(__pyx_t_9);
14449 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14451 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14453 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14454 __pyx_t_10 = __pyx_t_12;
14455 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14456 goto __pyx_L7_bool_binop_done;
14459 __pyx_L7_bool_binop_done:;
14460 __pyx_v_start = __pyx_t_10;
14469 __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
14470 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
14471 __Pyx_GOTREF(__pyx_t_9);
14472 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
14474 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14476 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
14477 __pyx_t_10 = __pyx_t_12;
14478 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14479 goto __pyx_L9_bool_binop_done;
14482 __pyx_L9_bool_binop_done:;
14483 __pyx_v_stop = __pyx_t_10;
14492 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
14493 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14494 __Pyx_GOTREF(__pyx_t_9);
14495 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
14497 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14499 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
14500 __pyx_t_10 = __pyx_t_12;
14501 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14502 goto __pyx_L11_bool_binop_done;
14505 __pyx_L11_bool_binop_done:;
14506 __pyx_v_step = __pyx_t_10;
14515 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
14516 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
14517 __Pyx_GOTREF(__pyx_t_9);
14518 __pyx_t_1 = (__pyx_t_9 != Py_None);
14519 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14520 __pyx_v_have_start = __pyx_t_1;
14529 __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
14530 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
14531 __Pyx_GOTREF(__pyx_t_9);
14532 __pyx_t_1 = (__pyx_t_9 != Py_None);
14533 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14534 __pyx_v_have_stop = __pyx_t_1;
14543 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
14544 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
14545 __Pyx_GOTREF(__pyx_t_9);
14546 __pyx_t_1 = (__pyx_t_9 != Py_None);
14547 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14548 __pyx_v_have_step = __pyx_t_1;
14557 __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
14558 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
14567 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
14568 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14579 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14581 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14590 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
14591 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14592 __pyx_t_2 = (__pyx_t_1 != 0);
14602 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
14603 __Pyx_XDECREF(((PyObject *)__pyx_r));
14612 __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
14613 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
14622 __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
14623 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
14632 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
14633 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
14634 __Pyx_GOTREF(__pyx_t_3);
14635 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
14636 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14656 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
14658 __Pyx_XDECREF(((PyObject *)__pyx_r));
14667 __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
14668 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
14669 __Pyx_GOTREF(__pyx_t_3);
14678 __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
14679 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
14680 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
14695 __Pyx_XDECREF(__pyx_t_3);
14696 __Pyx_XDECREF(__pyx_t_9);
14697 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14700 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14701 __Pyx_XDECREF(__pyx_v_index);
14702 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14703 __Pyx_TraceReturn(__pyx_r, 0);
14704 __Pyx_RefNannyFinishContext();
14716 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
14717 Py_ssize_t __pyx_v_new_shape;
14718 int __pyx_v_negative_step;
14720 __Pyx_TraceDeclarations
14724 int __pyx_lineno = 0;
14725 const char *__pyx_filename = NULL;
14726 int __pyx_clineno = 0;
14727 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
14736 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
14737 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14747 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
14748 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14758 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
14759 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14777 __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
14778 __pyx_t_1 = (0 <= __pyx_v_start);
14780 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14782 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14792 __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
14793 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
14821 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
14823 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14826 __pyx_t_2 = __pyx_t_1;
14827 goto __pyx_L6_bool_binop_done;
14829 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14830 __pyx_t_2 = __pyx_t_1;
14831 __pyx_L6_bool_binop_done:;
14832 __pyx_v_negative_step = __pyx_t_2;
14841 __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
14842 __pyx_t_1 = (__pyx_v_have_step != 0);
14845 __pyx_t_2 = __pyx_t_1;
14846 goto __pyx_L9_bool_binop_done;
14848 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14849 __pyx_t_2 = __pyx_t_1;
14850 __pyx_L9_bool_binop_done:;
14860 __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
14861 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
14879 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
14880 __pyx_t_2 = (__pyx_v_have_start != 0);
14890 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
14891 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14901 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
14902 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14911 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
14912 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14922 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
14951 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
14952 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14962 __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
14963 __pyx_t_2 = (__pyx_v_negative_step != 0);
14973 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
14974 __pyx_v_start = (__pyx_v_shape - 1);
14993 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
14995 __pyx_v_start = __pyx_v_shape;
15026 __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
15028 __pyx_t_2 = (__pyx_v_negative_step != 0);
15038 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15039 __pyx_v_start = (__pyx_v_shape - 1);
15058 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15073 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15074 __pyx_t_2 = (__pyx_v_have_stop != 0);
15084 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15085 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15095 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15096 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15105 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15106 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15116 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15145 __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
15146 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15156 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15157 __pyx_v_stop = __pyx_v_shape;
15186 __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
15188 __pyx_t_2 = (__pyx_v_negative_step != 0);
15198 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15199 __pyx_v_stop = -1L;
15218 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15220 __pyx_v_stop = __pyx_v_shape;
15233 __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
15234 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15244 __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
15263 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15272 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15282 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15300 __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
15301 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15311 __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
15312 __pyx_v_new_shape = 0;
15330 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
15331 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15340 __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
15341 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15350 __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
15351 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15362 __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
15363 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15373 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
15374 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15393 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
15395 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15396 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15407 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
15408 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15418 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
15419 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15429 __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
15430 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15440 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
15441 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15460 __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
15470 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
15471 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
15492 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
15494 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15514 __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
15530 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15532 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15534 __Pyx_PyGILState_Release(__pyx_gilstate_save);
15539 __Pyx_TraceReturn(Py_None, 1);
15551 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
15552 Py_ssize_t __pyx_v_shape;
15553 Py_ssize_t __pyx_v_stride;
15554 Py_ssize_t __pyx_v_suboffset;
15555 Py_ssize_t __pyx_v_itemsize;
15556 char *__pyx_v_resultp;
15558 __Pyx_TraceDeclarations
15559 __Pyx_RefNannyDeclarations
15560 Py_ssize_t __pyx_t_1;
15562 PyObject *__pyx_t_3 = NULL;
15563 PyObject *__pyx_t_4 = NULL;
15564 int __pyx_lineno = 0;
15565 const char *__pyx_filename = NULL;
15566 int __pyx_clineno = 0;
15567 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
15568 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
15577 __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
15578 __pyx_v_suboffset = -1L;
15587 __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
15588 __pyx_t_1 = __pyx_v_view->itemsize;
15589 __pyx_v_itemsize = __pyx_t_1;
15598 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
15599 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15609 __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
15610 if (unlikely(__pyx_v_itemsize == 0)) {
15611 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
15612 __PYX_ERR(1, 919, __pyx_L1_error)
15614 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
15615 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
15616 __PYX_ERR(1, 919, __pyx_L1_error)
15618 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
15627 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
15628 __pyx_v_stride = __pyx_v_itemsize;
15647 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
15649 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15658 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
15659 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15668 __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
15669 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15679 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
15680 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15700 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
15701 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15711 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
15712 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15721 __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
15722 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15723 if (unlikely(__pyx_t_2)) {
15732 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
15733 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
15734 __Pyx_GOTREF(__pyx_t_3);
15735 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
15736 __Pyx_GOTREF(__pyx_t_4);
15737 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15738 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
15739 __Pyx_GOTREF(__pyx_t_3);
15740 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15741 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15743 __PYX_ERR(1, 930, __pyx_L1_error)
15770 __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
15771 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15772 if (unlikely(__pyx_t_2)) {
15781 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
15782 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
15783 __Pyx_GOTREF(__pyx_t_3);
15784 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
15785 __Pyx_GOTREF(__pyx_t_4);
15786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15787 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
15788 __Pyx_GOTREF(__pyx_t_3);
15789 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15790 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15791 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15792 __PYX_ERR(1, 933, __pyx_L1_error)
15810 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
15811 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15820 __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
15821 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15831 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
15832 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15850 __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
15851 __pyx_r = __pyx_v_resultp;
15864 __Pyx_XDECREF(__pyx_t_3);
15865 __Pyx_XDECREF(__pyx_t_4);
15866 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15869 __Pyx_TraceReturn(Py_None, 0);
15870 __Pyx_RefNannyFinishContext();
15882 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15884 Py_ssize_t *__pyx_v_shape;
15885 Py_ssize_t *__pyx_v_strides;
15889 __Pyx_TraceDeclarations
15891 Py_ssize_t *__pyx_t_2;
15894 Py_ssize_t __pyx_t_5;
15895 Py_ssize_t __pyx_t_6;
15899 int __pyx_lineno = 0;
15900 const char *__pyx_filename = NULL;
15901 int __pyx_clineno = 0;
15902 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
15911 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
15912 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15913 __pyx_v_ndim = __pyx_t_1;
15922 __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
15923 __pyx_t_2 = __pyx_v_memslice->shape;
15924 __pyx_v_shape = __pyx_t_2;
15933 __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
15934 __pyx_t_2 = __pyx_v_memslice->strides;
15935 __pyx_v_strides = __pyx_t_2;
15944 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
15945 __pyx_t_3 = (__pyx_v_ndim / 2);
15946 __pyx_t_4 = __pyx_t_3;
15947 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15948 __pyx_v_i = __pyx_t_1;
15957 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
15958 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15967 __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
15968 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15969 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15970 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15971 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15980 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
15981 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15982 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15983 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15984 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15993 __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
15994 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15997 __pyx_t_7 = __pyx_t_8;
15998 goto __pyx_L6_bool_binop_done;
16000 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16001 __pyx_t_7 = __pyx_t_8;
16002 __pyx_L6_bool_binop_done:;
16012 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16013 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
16032 __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
16048 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16050 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16052 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16057 __Pyx_TraceReturn(Py_None, 1);
16070 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16071 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16072 __Pyx_RefNannyDeclarations
16073 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16074 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16077 __Pyx_RefNannyFinishContext();
16080 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16081 __Pyx_TraceDeclarations
16082 __Pyx_RefNannyDeclarations
16083 int __pyx_lineno = 0;
16084 const char *__pyx_filename = NULL;
16085 int __pyx_clineno = 0;
16086 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16087 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
16096 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
16097 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16110 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16112 __Pyx_TraceReturn(Py_None, 0);
16113 __Pyx_RefNannyFinishContext();
16124 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16125 PyObject *__pyx_r = NULL;
16126 __Pyx_TraceDeclarations
16127 __Pyx_RefNannyDeclarations
16129 PyObject *__pyx_t_2 = NULL;
16130 int __pyx_lineno = 0;
16131 const char *__pyx_filename = NULL;
16132 int __pyx_clineno = 0;
16133 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16134 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
16143 __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
16144 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16154 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16155 __Pyx_XDECREF(__pyx_r);
16156 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16157 __Pyx_GOTREF(__pyx_t_2);
16158 __pyx_r = __pyx_t_2;
16178 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
16180 __Pyx_XDECREF(__pyx_r);
16181 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
16182 __Pyx_GOTREF(__pyx_t_2);
16183 __pyx_r = __pyx_t_2;
16198 __Pyx_XDECREF(__pyx_t_2);
16199 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16202 __Pyx_XGIVEREF(__pyx_r);
16203 __Pyx_TraceReturn(__pyx_r, 0);
16204 __Pyx_RefNannyFinishContext();
16216 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16217 PyObject *__pyx_r = NULL;
16218 __Pyx_TraceDeclarations
16219 __Pyx_RefNannyDeclarations
16222 PyObject *__pyx_t_3 = NULL;
16223 int __pyx_lineno = 0;
16224 const char *__pyx_filename = NULL;
16225 int __pyx_clineno = 0;
16226 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16227 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
16236 __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
16237 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16247 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16248 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
16267 __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
16269 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
16270 __Pyx_GOTREF(__pyx_t_3);
16271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16284 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16287 __Pyx_XDECREF(__pyx_t_3);
16288 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16291 __Pyx_XGIVEREF(__pyx_r);
16292 __Pyx_TraceReturn(__pyx_r, 0);
16293 __Pyx_RefNannyFinishContext();
16306 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16307 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16308 PyObject *__pyx_r = 0;
16309 __Pyx_RefNannyDeclarations
16310 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16311 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16314 __Pyx_RefNannyFinishContext();
16318 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16319 PyObject *__pyx_r = NULL;
16320 __Pyx_TraceDeclarations
16321 __Pyx_RefNannyDeclarations
16322 int __pyx_lineno = 0;
16323 const char *__pyx_filename = NULL;
16324 int __pyx_clineno = 0;
16325 __Pyx_RefNannySetupContext(
"__get__", 0);
16326 __Pyx_TraceCall(
"__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
16335 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
16336 __Pyx_XDECREF(__pyx_r);
16337 __Pyx_INCREF(__pyx_v_self->from_object);
16338 __pyx_r = __pyx_v_self->from_object;
16351 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16354 __Pyx_XGIVEREF(__pyx_r);
16355 __Pyx_TraceReturn(__pyx_r, 0);
16356 __Pyx_RefNannyFinishContext();
16367 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16368 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16369 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16370 PyObject *__pyx_r = 0;
16371 __Pyx_RefNannyDeclarations
16372 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16373 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16376 __Pyx_RefNannyFinishContext();
16380 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16381 PyObject *__pyx_r = NULL;
16382 __Pyx_TraceDeclarations
16383 __Pyx_RefNannyDeclarations
16384 PyObject *__pyx_t_1 = NULL;
16385 int __pyx_lineno = 0;
16386 const char *__pyx_filename = NULL;
16387 int __pyx_clineno = 0;
16388 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16389 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16397 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16398 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16399 __Pyx_GOTREF(__pyx_t_1);
16400 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16401 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16402 __PYX_ERR(1, 2, __pyx_L1_error)
16412 __Pyx_XDECREF(__pyx_t_1);
16413 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16415 __Pyx_XGIVEREF(__pyx_r);
16416 __Pyx_TraceReturn(__pyx_r, 0);
16417 __Pyx_RefNannyFinishContext();
16429 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16430 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16431 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16432 PyObject *__pyx_r = 0;
16433 __Pyx_RefNannyDeclarations
16434 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16435 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16438 __Pyx_RefNannyFinishContext();
16442 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16443 PyObject *__pyx_r = NULL;
16444 __Pyx_TraceDeclarations
16445 __Pyx_RefNannyDeclarations
16446 PyObject *__pyx_t_1 = NULL;
16447 int __pyx_lineno = 0;
16448 const char *__pyx_filename = NULL;
16449 int __pyx_clineno = 0;
16450 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16451 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16458 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16459 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16460 __Pyx_GOTREF(__pyx_t_1);
16461 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16462 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16463 __PYX_ERR(1, 4, __pyx_L1_error)
16474 __Pyx_XDECREF(__pyx_t_1);
16475 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16477 __Pyx_XGIVEREF(__pyx_r);
16478 __Pyx_TraceReturn(__pyx_r, 0);
16479 __Pyx_RefNannyFinishContext();
16491 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
16492 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16493 Py_ssize_t __pyx_v_suboffset;
16494 PyObject *__pyx_v_length = NULL;
16495 PyObject *__pyx_r = NULL;
16496 __Pyx_TraceDeclarations
16497 __Pyx_RefNannyDeclarations
16499 PyObject *__pyx_t_2 = NULL;
16500 PyObject *__pyx_t_3 = NULL;
16501 __Pyx_TypeInfo *__pyx_t_4;
16502 Py_buffer __pyx_t_5;
16503 Py_ssize_t *__pyx_t_6;
16504 Py_ssize_t *__pyx_t_7;
16505 Py_ssize_t *__pyx_t_8;
16506 Py_ssize_t __pyx_t_9;
16507 int __pyx_lineno = 0;
16508 const char *__pyx_filename = NULL;
16509 int __pyx_clineno = 0;
16510 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
16511 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
16520 __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
16521 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16531 __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
16532 __Pyx_XDECREF(__pyx_r);
16533 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16552 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
16553 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
16554 __Pyx_GOTREF(__pyx_t_2);
16555 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
16556 __Pyx_GOTREF(__pyx_t_3);
16557 __Pyx_INCREF(Py_None);
16558 __Pyx_GIVEREF(Py_None);
16559 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
16560 __Pyx_INCREF(__pyx_int_0);
16561 __Pyx_GIVEREF(__pyx_int_0);
16562 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
16563 __Pyx_GIVEREF(__pyx_t_2);
16564 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16566 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
16567 __Pyx_GOTREF(__pyx_t_2);
16568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16569 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16579 __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
16580 __pyx_v_result->from_slice = __pyx_v_memviewslice;
16589 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
16590 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16599 __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
16600 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
16601 __Pyx_GOTREF(__pyx_t_2);
16602 __Pyx_GIVEREF(__pyx_t_2);
16603 __Pyx_GOTREF(__pyx_v_result->from_object);
16604 __Pyx_DECREF(__pyx_v_result->from_object);
16605 __pyx_v_result->from_object = __pyx_t_2;
16615 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
16616 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16617 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16626 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
16627 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16628 __pyx_v_result->__pyx_base.view = __pyx_t_5;
16637 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
16638 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
16647 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
16648 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16657 __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
16658 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16667 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
16668 Py_INCREF(Py_None);
16677 __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
16678 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16688 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
16689 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16708 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
16710 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16721 __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
16722 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16731 __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
16732 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16741 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
16742 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16751 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
16752 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16753 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16754 __pyx_t_6 = __pyx_t_8;
16755 __pyx_v_suboffset = (__pyx_t_6[0]);
16764 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
16765 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16775 __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
16776 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16785 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
16786 goto __pyx_L6_break;
16806 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
16807 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16808 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16817 __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
16818 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16819 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16820 __pyx_t_6 = __pyx_t_8;
16821 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
16822 __Pyx_GOTREF(__pyx_t_2);
16823 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16833 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
16834 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
16835 __Pyx_GOTREF(__pyx_t_2);
16836 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
16837 __Pyx_GOTREF(__pyx_t_3);
16838 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16839 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
16840 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16841 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16851 __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
16852 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16861 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
16862 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16871 __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
16872 __Pyx_XDECREF(__pyx_r);
16873 __Pyx_INCREF(((PyObject *)__pyx_v_result));
16874 __pyx_r = ((PyObject *)__pyx_v_result);
16887 __Pyx_XDECREF(__pyx_t_2);
16888 __Pyx_XDECREF(__pyx_t_3);
16889 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16892 __Pyx_XDECREF((PyObject *)__pyx_v_result);
16893 __Pyx_XDECREF(__pyx_v_length);
16894 __Pyx_XGIVEREF(__pyx_r);
16895 __Pyx_TraceReturn(__pyx_r, 0);
16896 __Pyx_RefNannyFinishContext();
16908 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16909 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16910 __Pyx_memviewslice *__pyx_r;
16911 __Pyx_TraceDeclarations
16912 __Pyx_RefNannyDeclarations
16915 PyObject *__pyx_t_3 = NULL;
16916 int __pyx_lineno = 0;
16917 const char *__pyx_filename = NULL;
16918 int __pyx_clineno = 0;
16919 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
16920 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
16929 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
16930 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16931 __pyx_t_2 = (__pyx_t_1 != 0);
16941 __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
16942 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
16943 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16944 __Pyx_INCREF(__pyx_t_3);
16945 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16955 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
16956 __pyx_r = (&__pyx_v_obj->from_slice);
16975 __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
16977 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16986 __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
16987 __pyx_r = __pyx_v_mslice;
17001 __Pyx_XDECREF(__pyx_t_3);
17002 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17005 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17006 __Pyx_TraceReturn(Py_None, 0);
17007 __Pyx_RefNannyFinishContext();
17019 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17021 Py_ssize_t *__pyx_v_shape;
17022 Py_ssize_t *__pyx_v_strides;
17023 Py_ssize_t *__pyx_v_suboffsets;
17024 __Pyx_TraceDeclarations
17025 __Pyx_RefNannyDeclarations
17026 Py_ssize_t *__pyx_t_1;
17030 Py_ssize_t __pyx_t_5;
17031 int __pyx_lineno = 0;
17032 const char *__pyx_filename = NULL;
17033 int __pyx_clineno = 0;
17034 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17035 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
17044 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17045 __pyx_t_1 = __pyx_v_memview->view.shape;
17046 __pyx_v_shape = __pyx_t_1;
17055 __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
17056 __pyx_t_1 = __pyx_v_memview->view.strides;
17057 __pyx_v_strides = __pyx_t_1;
17066 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17067 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17068 __pyx_v_suboffsets = __pyx_t_1;
17077 __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
17078 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17087 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17088 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17097 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17098 __pyx_t_2 = __pyx_v_memview->view.ndim;
17099 __pyx_t_3 = __pyx_t_2;
17100 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17101 __pyx_v_dim = __pyx_t_4;
17110 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17111 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17120 __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
17121 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17130 __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
17131 if ((__pyx_v_suboffsets != 0)) {
17132 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17136 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17150 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17152 __Pyx_TraceReturn(Py_None, 0);
17153 __Pyx_RefNannyFinishContext();
17164 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17165 __Pyx_memviewslice __pyx_v_memviewslice;
17166 PyObject *__pyx_r = NULL;
17167 __Pyx_TraceDeclarations
17168 __Pyx_RefNannyDeclarations
17169 PyObject *__pyx_t_1 = NULL;
17170 int __pyx_lineno = 0;
17171 const char *__pyx_filename = NULL;
17172 int __pyx_clineno = 0;
17173 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17174 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
17183 __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
17184 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17193 __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
17194 __Pyx_XDECREF(__pyx_r);
17195 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
17196 __Pyx_GOTREF(__pyx_t_1);
17197 __pyx_r = __pyx_t_1;
17211 __Pyx_XDECREF(__pyx_t_1);
17212 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17215 __Pyx_XGIVEREF(__pyx_r);
17216 __Pyx_TraceReturn(__pyx_r, 0);
17217 __Pyx_RefNannyFinishContext();
17229 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17230 PyObject *(*__pyx_v_to_object_func)(
char *);
17231 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17232 PyObject *__pyx_r = NULL;
17233 __Pyx_TraceDeclarations
17234 __Pyx_RefNannyDeclarations
17237 PyObject *(*__pyx_t_3)(
char *);
17238 int (*__pyx_t_4)(
char *, PyObject *);
17239 PyObject *__pyx_t_5 = NULL;
17240 int __pyx_lineno = 0;
17241 const char *__pyx_filename = NULL;
17242 int __pyx_clineno = 0;
17243 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17244 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
17253 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17254 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17255 __pyx_t_2 = (__pyx_t_1 != 0);
17265 __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
17266 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17267 __pyx_v_to_object_func = __pyx_t_3;
17276 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17277 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17278 __pyx_v_to_dtype_func = __pyx_t_4;
17297 __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
17299 __pyx_v_to_object_func = NULL;
17308 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
17309 __pyx_v_to_dtype_func = NULL;
17320 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
17321 __Pyx_XDECREF(__pyx_r);
17330 __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
17331 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
17332 __Pyx_GOTREF(__pyx_t_5);
17333 __pyx_r = __pyx_t_5;
17347 __Pyx_XDECREF(__pyx_t_5);
17348 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17351 __Pyx_XGIVEREF(__pyx_r);
17352 __Pyx_TraceReturn(__pyx_r, 0);
17353 __Pyx_RefNannyFinishContext();
17365 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17366 Py_ssize_t __pyx_r;
17367 __Pyx_TraceDeclarations
17369 int __pyx_lineno = 0;
17370 const char *__pyx_filename = NULL;
17371 int __pyx_clineno = 0;
17372 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
17381 __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
17382 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17392 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
17393 __pyx_r = (-__pyx_v_arg);
17412 __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
17414 __pyx_r = __pyx_v_arg;
17428 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17431 __Pyx_TraceReturn(Py_None, 1);
17443 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
17445 Py_ssize_t __pyx_v_c_stride;
17446 Py_ssize_t __pyx_v_f_stride;
17448 __Pyx_TraceDeclarations
17453 int __pyx_lineno = 0;
17454 const char *__pyx_filename = NULL;
17455 int __pyx_clineno = 0;
17456 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
17465 __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
17466 __pyx_v_c_stride = 0;
17475 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
17476 __pyx_v_f_stride = 0;
17485 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
17486 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17487 __pyx_v_i = __pyx_t_1;
17496 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
17497 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17507 __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
17508 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17517 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
17518 goto __pyx_L4_break;
17538 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
17539 __pyx_t_1 = __pyx_v_ndim;
17540 __pyx_t_3 = __pyx_t_1;
17541 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17542 __pyx_v_i = __pyx_t_4;
17551 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
17552 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17562 __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
17563 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17572 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
17573 goto __pyx_L7_break;
17593 __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
17594 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17604 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
17624 __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
17640 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17643 __Pyx_TraceReturn(Py_None, 1);
17655 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17656 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17657 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
17658 Py_ssize_t __pyx_v_dst_extent;
17659 Py_ssize_t __pyx_v_src_stride;
17660 Py_ssize_t __pyx_v_dst_stride;
17664 Py_ssize_t __pyx_t_4;
17665 Py_ssize_t __pyx_t_5;
17666 Py_ssize_t __pyx_t_6;
17675 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17684 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17693 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17702 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17711 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17721 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17724 __pyx_t_1 = __pyx_t_2;
17725 goto __pyx_L5_bool_binop_done;
17727 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17730 __pyx_t_1 = __pyx_t_2;
17731 goto __pyx_L5_bool_binop_done;
17741 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17743 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17745 __pyx_t_3 = (__pyx_t_2 != 0);
17746 __pyx_t_1 = __pyx_t_3;
17747 __pyx_L5_bool_binop_done:;
17765 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17785 __pyx_t_4 = __pyx_v_dst_extent;
17786 __pyx_t_5 = __pyx_t_4;
17787 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17788 __pyx_v_i = __pyx_t_6;
17797 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17806 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17815 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17838 __pyx_t_4 = __pyx_v_dst_extent;
17839 __pyx_t_5 = __pyx_t_4;
17840 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17841 __pyx_v_i = __pyx_t_6;
17850 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
17859 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17868 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17892 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
17893 __Pyx_TraceDeclarations
17894 int __pyx_lineno = 0;
17895 const char *__pyx_filename = NULL;
17896 int __pyx_clineno = 0;
17897 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
17906 __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
17907 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17920 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17922 __Pyx_TraceReturn(Py_None, 1);
17933 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
17934 Py_ssize_t __pyx_v_shape;
17935 Py_ssize_t __pyx_v_size;
17936 Py_ssize_t __pyx_r;
17937 __Pyx_TraceDeclarations
17938 Py_ssize_t __pyx_t_1;
17939 Py_ssize_t *__pyx_t_2;
17940 Py_ssize_t *__pyx_t_3;
17941 Py_ssize_t *__pyx_t_4;
17942 int __pyx_lineno = 0;
17943 const char *__pyx_filename = NULL;
17944 int __pyx_clineno = 0;
17945 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
17954 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
17955 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17956 __pyx_v_size = __pyx_t_1;
17965 __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
17966 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17967 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17968 __pyx_t_2 = __pyx_t_4;
17969 __pyx_v_shape = (__pyx_t_2[0]);
17978 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
17979 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17989 __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
17990 __pyx_r = __pyx_v_size;
18003 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18006 __Pyx_TraceReturn(Py_None, 1);
18018 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18020 Py_ssize_t __pyx_r;
18021 __Pyx_TraceDeclarations
18026 int __pyx_lineno = 0;
18027 const char *__pyx_filename = NULL;
18028 int __pyx_clineno = 0;
18029 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
18038 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18039 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18049 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18050 __pyx_t_2 = __pyx_v_ndim;
18051 __pyx_t_3 = __pyx_t_2;
18052 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18053 __pyx_v_idx = __pyx_t_4;
18062 __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
18063 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18072 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18073 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18093 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18095 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18096 __pyx_v_idx = __pyx_t_2;
18105 __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
18106 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18115 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18116 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18128 __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
18129 __pyx_r = __pyx_v_stride;
18142 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18145 __Pyx_TraceReturn(Py_None, 1);
18157 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18159 void *__pyx_v_result;
18160 size_t __pyx_v_itemsize;
18161 size_t __pyx_v_size;
18163 __Pyx_TraceDeclarations
18164 Py_ssize_t __pyx_t_1;
18167 struct __pyx_memoryview_obj *__pyx_t_4;
18170 int __pyx_lineno = 0;
18171 const char *__pyx_filename = NULL;
18172 int __pyx_clineno = 0;
18173 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
18182 __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
18183 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18184 __pyx_v_itemsize = __pyx_t_1;
18193 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18194 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18203 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18204 __pyx_v_result = malloc(__pyx_v_size);
18213 __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
18214 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18224 __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
18225 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
18243 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18244 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18253 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18254 __pyx_t_4 = __pyx_v_src->memview;
18255 __pyx_v_tmpslice->memview = __pyx_t_4;
18264 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18265 __pyx_t_3 = __pyx_v_ndim;
18266 __pyx_t_5 = __pyx_t_3;
18267 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18268 __pyx_v_i = __pyx_t_6;
18277 __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
18278 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18287 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18288 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18298 __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
18299 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18308 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
18309 __pyx_t_3 = __pyx_v_ndim;
18310 __pyx_t_5 = __pyx_t_3;
18311 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18312 __pyx_v_i = __pyx_t_6;
18321 __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
18322 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18332 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
18333 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18352 __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
18353 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18363 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
18364 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18383 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
18385 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18396 __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
18397 __pyx_r = __pyx_v_result;
18412 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18414 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18416 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18421 __Pyx_TraceReturn(Py_None, 1);
18433 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18435 __Pyx_TraceDeclarations
18436 __Pyx_RefNannyDeclarations
18437 PyObject *__pyx_t_1 = NULL;
18438 PyObject *__pyx_t_2 = NULL;
18439 PyObject *__pyx_t_3 = NULL;
18440 PyObject *__pyx_t_4 = NULL;
18441 int __pyx_lineno = 0;
18442 const char *__pyx_filename = NULL;
18443 int __pyx_clineno = 0;
18445 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18447 __Pyx_RefNannySetupContext(
"_err_extents", 0);
18448 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
18457 __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
18458 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
18459 __Pyx_GOTREF(__pyx_t_1);
18460 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
18461 __Pyx_GOTREF(__pyx_t_2);
18462 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
18463 __Pyx_GOTREF(__pyx_t_3);
18464 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
18465 __Pyx_GOTREF(__pyx_t_4);
18466 __Pyx_GIVEREF(__pyx_t_1);
18467 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18468 __Pyx_GIVEREF(__pyx_t_2);
18469 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18470 __Pyx_GIVEREF(__pyx_t_3);
18471 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18483 __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
18484 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
18485 __Pyx_GOTREF(__pyx_t_3);
18486 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18487 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
18488 __Pyx_GOTREF(__pyx_t_4);
18489 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18490 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18491 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18492 __PYX_ERR(1, 1255, __pyx_L1_error)
18504 __Pyx_XDECREF(__pyx_t_1);
18505 __Pyx_XDECREF(__pyx_t_2);
18506 __Pyx_XDECREF(__pyx_t_3);
18507 __Pyx_XDECREF(__pyx_t_4);
18508 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18510 __Pyx_TraceReturn(Py_None, 0);
18511 __Pyx_RefNannyFinishContext();
18513 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18526 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
18528 __Pyx_TraceDeclarations
18529 __Pyx_RefNannyDeclarations
18530 PyObject *__pyx_t_1 = NULL;
18531 PyObject *__pyx_t_2 = NULL;
18532 PyObject *__pyx_t_3 = NULL;
18533 PyObject *__pyx_t_4 = NULL;
18534 int __pyx_lineno = 0;
18535 const char *__pyx_filename = NULL;
18536 int __pyx_clineno = 0;
18538 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18540 __Pyx_RefNannySetupContext(
"_err_dim", 0);
18541 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
18542 __Pyx_INCREF(__pyx_v_error);
18551 __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
18552 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
18553 __Pyx_GOTREF(__pyx_t_2);
18554 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
18555 __Pyx_GOTREF(__pyx_t_3);
18556 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
18557 __Pyx_GOTREF(__pyx_t_4);
18558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18559 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18560 __Pyx_INCREF(__pyx_v_error);
18561 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18562 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18563 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
18564 if (likely(__pyx_t_2)) {
18565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
18566 __Pyx_INCREF(__pyx_t_2);
18567 __Pyx_INCREF(
function);
18568 __Pyx_DECREF_SET(__pyx_t_3,
function);
18571 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
18572 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18573 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18574 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
18575 __Pyx_GOTREF(__pyx_t_1);
18576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18577 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18579 __PYX_ERR(1, 1260, __pyx_L1_error)
18591 __Pyx_XDECREF(__pyx_t_1);
18592 __Pyx_XDECREF(__pyx_t_2);
18593 __Pyx_XDECREF(__pyx_t_3);
18594 __Pyx_XDECREF(__pyx_t_4);
18595 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
18597 __Pyx_XDECREF(__pyx_v_error);
18598 __Pyx_TraceReturn(Py_None, 0);
18599 __Pyx_RefNannyFinishContext();
18601 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18614 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
18616 __Pyx_TraceDeclarations
18617 __Pyx_RefNannyDeclarations
18619 PyObject *__pyx_t_2 = NULL;
18620 PyObject *__pyx_t_3 = NULL;
18621 PyObject *__pyx_t_4 = NULL;
18622 PyObject *__pyx_t_5 = NULL;
18623 int __pyx_lineno = 0;
18624 const char *__pyx_filename = NULL;
18625 int __pyx_clineno = 0;
18627 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18629 __Pyx_RefNannySetupContext(
"_err", 0);
18630 __Pyx_TraceCall(
"_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
18631 __Pyx_INCREF(__pyx_v_error);
18640 __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
18641 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18642 if (unlikely(__pyx_t_1)) {
18651 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
18652 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
18653 __Pyx_GOTREF(__pyx_t_3);
18654 __Pyx_INCREF(__pyx_v_error);
18655 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
18656 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18657 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18658 if (likely(__pyx_t_5)) {
18659 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
18660 __Pyx_INCREF(__pyx_t_5);
18661 __Pyx_INCREF(
function);
18662 __Pyx_DECREF_SET(__pyx_t_4,
function);
18665 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
18666 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18667 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18668 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
18669 __Pyx_GOTREF(__pyx_t_2);
18670 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18671 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18672 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18673 __PYX_ERR(1, 1265, __pyx_L1_error)
18691 __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
18693 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18694 __PYX_ERR(1, 1267, __pyx_L1_error)
18707 __Pyx_XDECREF(__pyx_t_2);
18708 __Pyx_XDECREF(__pyx_t_3);
18709 __Pyx_XDECREF(__pyx_t_4);
18710 __Pyx_XDECREF(__pyx_t_5);
18711 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
18713 __Pyx_XDECREF(__pyx_v_error);
18714 __Pyx_TraceReturn(Py_None, 0);
18715 __Pyx_RefNannyFinishContext();
18717 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18730 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
18731 void *__pyx_v_tmpdata;
18732 size_t __pyx_v_itemsize;
18734 char __pyx_v_order;
18735 int __pyx_v_broadcasting;
18736 int __pyx_v_direct_copy;
18737 __Pyx_memviewslice __pyx_v_tmp;
18740 __Pyx_TraceDeclarations
18741 Py_ssize_t __pyx_t_1;
18749 int __pyx_lineno = 0;
18750 const char *__pyx_filename = NULL;
18751 int __pyx_clineno = 0;
18752 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
18761 __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
18762 __pyx_v_tmpdata = NULL;
18771 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
18772 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18773 __pyx_v_itemsize = __pyx_t_1;
18782 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
18783 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18792 __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
18793 __pyx_v_broadcasting = 0;
18802 __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
18803 __pyx_v_direct_copy = 0;
18812 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
18813 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18823 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
18824 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18843 __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
18844 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18854 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
18855 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18874 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
18875 __pyx_t_3 = __pyx_v_dst_ndim;
18876 __pyx_t_4 = __pyx_v_src_ndim;
18877 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
18878 __pyx_t_5 = __pyx_t_3;
18880 __pyx_t_5 = __pyx_t_4;
18882 __pyx_v_ndim = __pyx_t_5;
18891 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
18892 __pyx_t_5 = __pyx_v_ndim;
18893 __pyx_t_3 = __pyx_t_5;
18894 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18895 __pyx_v_i = __pyx_t_4;
18904 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
18905 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18915 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
18916 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18926 __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
18927 __pyx_v_broadcasting = 1;
18936 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
18937 (__pyx_v_src.strides[__pyx_v_i]) = 0;
18956 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
18958 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
18978 __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
18979 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18989 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
18990 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
19009 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19010 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19020 __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
19021 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19031 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19032 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19050 __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
19051 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
19052 __pyx_v_tmpdata = __pyx_t_7;
19061 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19062 __pyx_v_src = __pyx_v_tmp;
19080 __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
19081 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19091 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19092 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19102 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19103 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19122 __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
19123 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19133 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19134 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19153 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19154 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19164 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19165 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19174 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19175 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19184 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19185 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19194 __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
19195 free(__pyx_v_tmpdata);
19204 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19233 __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
19234 __pyx_t_2 = (__pyx_v_order ==
'F');
19236 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19238 __pyx_t_8 = (__pyx_t_2 != 0);
19248 __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
19249 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
19258 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19259 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
19277 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19278 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19287 __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
19288 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19297 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19298 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19307 __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
19308 free(__pyx_v_tmpdata);
19317 __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
19333 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19335 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19337 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19342 __Pyx_TraceReturn(Py_None, 1);
19354 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
19356 int __pyx_v_offset;
19357 __Pyx_TraceDeclarations
19361 int __pyx_lineno = 0;
19362 const char *__pyx_filename = NULL;
19363 int __pyx_clineno = 0;
19364 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
19373 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
19374 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19383 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
19384 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19385 __pyx_v_i = __pyx_t_1;
19394 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
19395 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19404 __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
19405 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19414 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
19415 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19425 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
19426 __pyx_t_1 = __pyx_v_offset;
19427 __pyx_t_2 = __pyx_t_1;
19428 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19429 __pyx_v_i = __pyx_t_3;
19438 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
19439 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19448 __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
19449 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19458 __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
19459 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19473 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19475 __Pyx_TraceReturn(Py_None, 1);
19486 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
19487 __Pyx_TraceDeclarations
19489 int __pyx_lineno = 0;
19490 const char *__pyx_filename = NULL;
19491 int __pyx_clineno = 0;
19492 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
19501 __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
19502 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19512 __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
19513 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19535 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19537 __Pyx_TraceReturn(Py_None, 1);
19548 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19549 __Pyx_TraceDeclarations
19550 __Pyx_RefNannyDeclarations
19551 int __pyx_lineno = 0;
19552 const char *__pyx_filename = NULL;
19553 int __pyx_clineno = 0;
19555 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19557 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
19558 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
19567 __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
19568 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19581 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19583 __Pyx_TraceReturn(Py_None, 0);
19584 __Pyx_RefNannyFinishContext();
19586 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19598 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
19599 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19600 __Pyx_TraceDeclarations
19601 __Pyx_RefNannyDeclarations
19602 Py_ssize_t __pyx_t_1;
19603 Py_ssize_t __pyx_t_2;
19604 Py_ssize_t __pyx_t_3;
19606 int __pyx_lineno = 0;
19607 const char *__pyx_filename = NULL;
19608 int __pyx_clineno = 0;
19609 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
19610 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
19619 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
19620 __pyx_t_1 = (__pyx_v_shape[0]);
19621 __pyx_t_2 = __pyx_t_1;
19622 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19623 __pyx_v_i = __pyx_t_3;
19632 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
19633 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19643 __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
19644 __pyx_t_4 = (__pyx_v_inc != 0);
19654 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
19655 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19674 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
19676 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19697 __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
19707 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
19708 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
19719 __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
19720 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19734 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19736 __Pyx_TraceReturn(Py_None, 0);
19737 __Pyx_RefNannyFinishContext();
19748 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
19749 __Pyx_TraceDeclarations
19750 int __pyx_lineno = 0;
19751 const char *__pyx_filename = NULL;
19752 int __pyx_clineno = 0;
19753 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
19762 __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
19763 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19772 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
19773 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
19782 __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
19783 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19796 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19798 __Pyx_TraceReturn(Py_None, 1);
19809 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
19810 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19811 Py_ssize_t __pyx_v_stride;
19812 Py_ssize_t __pyx_v_extent;
19813 __Pyx_TraceDeclarations
19815 Py_ssize_t __pyx_t_2;
19816 Py_ssize_t __pyx_t_3;
19817 Py_ssize_t __pyx_t_4;
19818 int __pyx_lineno = 0;
19819 const char *__pyx_filename = NULL;
19820 int __pyx_clineno = 0;
19821 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
19830 __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
19831 __pyx_v_stride = (__pyx_v_strides[0]);
19840 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
19841 __pyx_v_extent = (__pyx_v_shape[0]);
19850 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
19851 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19861 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
19862 __pyx_t_2 = __pyx_v_extent;
19863 __pyx_t_3 = __pyx_t_2;
19864 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19865 __pyx_v_i = __pyx_t_4;
19874 __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
19875 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19884 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
19885 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19905 __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
19907 __pyx_t_2 = __pyx_v_extent;
19908 __pyx_t_3 = __pyx_t_2;
19909 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19910 __pyx_v_i = __pyx_t_4;
19919 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
19920 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
19929 __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
19930 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19946 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19948 __Pyx_TraceReturn(Py_None, 1);
19958 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19959 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
19960 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19961 PyObject *__pyx_v___pyx_type = 0;
19962 long __pyx_v___pyx_checksum;
19963 PyObject *__pyx_v___pyx_state = 0;
19964 int __pyx_lineno = 0;
19965 const char *__pyx_filename = NULL;
19966 int __pyx_clineno = 0;
19967 PyObject *__pyx_r = 0;
19968 __Pyx_RefNannyDeclarations
19969 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
19971 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
19972 PyObject* values[3] = {0,0,0};
19973 if (unlikely(__pyx_kwds)) {
19974 Py_ssize_t kw_args;
19975 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19976 switch (pos_args) {
19977 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19978 CYTHON_FALLTHROUGH;
19979 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19980 CYTHON_FALLTHROUGH;
19981 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19982 CYTHON_FALLTHROUGH;
19984 default:
goto __pyx_L5_argtuple_error;
19986 kw_args = PyDict_Size(__pyx_kwds);
19987 switch (pos_args) {
19989 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
19990 else goto __pyx_L5_argtuple_error;
19991 CYTHON_FALLTHROUGH;
19993 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19995 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
19997 CYTHON_FALLTHROUGH;
19999 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20001 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20004 if (unlikely(kw_args > 0)) {
20005 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20007 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20008 goto __pyx_L5_argtuple_error;
20010 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20011 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20012 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20014 __pyx_v___pyx_type = values[0];
20015 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20016 __pyx_v___pyx_state = values[2];
20018 goto __pyx_L4_argument_unpacking_done;
20019 __pyx_L5_argtuple_error:;
20020 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20022 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20023 __Pyx_RefNannyFinishContext();
20025 __pyx_L4_argument_unpacking_done:;
20026 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20029 __Pyx_RefNannyFinishContext();
20033 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20034 PyObject *__pyx_v___pyx_PickleError = 0;
20035 PyObject *__pyx_v___pyx_result = 0;
20036 PyObject *__pyx_r = NULL;
20037 __Pyx_TraceDeclarations
20038 __Pyx_RefNannyDeclarations
20039 PyObject *__pyx_t_1 = NULL;
20042 PyObject *__pyx_t_4 = NULL;
20043 PyObject *__pyx_t_5 = NULL;
20044 PyObject *__pyx_t_6 = NULL;
20045 int __pyx_lineno = 0;
20046 const char *__pyx_filename = NULL;
20047 int __pyx_clineno = 0;
20048 __Pyx_TraceFrameInit(__pyx_codeobj__36)
20049 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20050 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20059 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20060 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20061 __Pyx_GOTREF(__pyx_t_1);
20062 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__37, Py_NE));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20064 __pyx_t_3 = (__pyx_t_2 != 0);
20074 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20075 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20076 __Pyx_GOTREF(__pyx_t_1);
20077 __Pyx_INCREF(__pyx_n_s_PickleError);
20078 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20079 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20080 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20081 __Pyx_GOTREF(__pyx_t_4);
20082 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20083 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20084 __Pyx_GOTREF(__pyx_t_1);
20085 __Pyx_INCREF(__pyx_t_1);
20086 __pyx_v___pyx_PickleError = __pyx_t_1;
20087 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20088 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20097 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20098 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20099 __Pyx_GOTREF(__pyx_t_1);
20100 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20101 __Pyx_GOTREF(__pyx_t_5);
20102 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20103 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20104 __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20105 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20106 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20107 if (likely(__pyx_t_6)) {
20108 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20109 __Pyx_INCREF(__pyx_t_6);
20110 __Pyx_INCREF(
function);
20111 __Pyx_DECREF_SET(__pyx_t_1,
function);
20114 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
20115 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20116 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20117 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20118 __Pyx_GOTREF(__pyx_t_4);
20119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20120 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20121 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20122 __PYX_ERR(1, 6, __pyx_L1_error)
20140 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20141 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20142 __Pyx_GOTREF(__pyx_t_1);
20144 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20145 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20146 if (likely(__pyx_t_5)) {
20147 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
20148 __Pyx_INCREF(__pyx_t_5);
20149 __Pyx_INCREF(
function);
20150 __Pyx_DECREF_SET(__pyx_t_1,
function);
20153 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
20154 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20155 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20156 __Pyx_GOTREF(__pyx_t_4);
20157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20158 __pyx_v___pyx_result = __pyx_t_4;
20168 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20169 __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20170 __pyx_t_2 = (__pyx_t_3 != 0);
20180 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20181 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((
void)PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20182 __pyx_t_4 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20183 __Pyx_GOTREF(__pyx_t_4);
20184 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20202 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20203 __Pyx_XDECREF(__pyx_r);
20204 __Pyx_INCREF(__pyx_v___pyx_result);
20205 __pyx_r = __pyx_v___pyx_result;
20216 __Pyx_XDECREF(__pyx_t_1);
20217 __Pyx_XDECREF(__pyx_t_4);
20218 __Pyx_XDECREF(__pyx_t_5);
20219 __Pyx_XDECREF(__pyx_t_6);
20220 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20223 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20224 __Pyx_XDECREF(__pyx_v___pyx_result);
20225 __Pyx_XGIVEREF(__pyx_r);
20226 __Pyx_TraceReturn(__pyx_r, 0);
20227 __Pyx_RefNannyFinishContext();
20239 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20240 PyObject *__pyx_r = NULL;
20241 __Pyx_TraceDeclarations
20242 __Pyx_RefNannyDeclarations
20243 PyObject *__pyx_t_1 = NULL;
20245 Py_ssize_t __pyx_t_3;
20248 PyObject *__pyx_t_6 = NULL;
20249 PyObject *__pyx_t_7 = NULL;
20250 PyObject *__pyx_t_8 = NULL;
20251 int __pyx_lineno = 0;
20252 const char *__pyx_filename = NULL;
20253 int __pyx_clineno = 0;
20254 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20255 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20264 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20265 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20266 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20267 __PYX_ERR(1, 12, __pyx_L1_error)
20269 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20270 __Pyx_GOTREF(__pyx_t_1);
20271 __Pyx_GIVEREF(__pyx_t_1);
20272 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20273 __Pyx_DECREF(__pyx_v___pyx_result->name);
20274 __pyx_v___pyx_result->name = __pyx_t_1;
20283 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20284 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20285 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20286 __PYX_ERR(1, 13, __pyx_L1_error)
20288 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20289 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20292 __pyx_t_2 = __pyx_t_4;
20293 goto __pyx_L4_bool_binop_done;
20295 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20296 __pyx_t_5 = (__pyx_t_4 != 0);
20297 __pyx_t_2 = __pyx_t_5;
20298 __pyx_L4_bool_binop_done:;
20306 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20307 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20308 __Pyx_GOTREF(__pyx_t_6);
20309 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20310 __Pyx_GOTREF(__pyx_t_7);
20311 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20312 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20313 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20314 __PYX_ERR(1, 14, __pyx_L1_error)
20316 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20317 __Pyx_GOTREF(__pyx_t_6);
20319 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20320 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20321 if (likely(__pyx_t_8)) {
20322 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
20323 __Pyx_INCREF(__pyx_t_8);
20324 __Pyx_INCREF(
function);
20325 __Pyx_DECREF_SET(__pyx_t_7,
function);
20328 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20329 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20330 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20331 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20332 __Pyx_GOTREF(__pyx_t_1);
20333 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20353 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20356 __Pyx_XDECREF(__pyx_t_1);
20357 __Pyx_XDECREF(__pyx_t_6);
20358 __Pyx_XDECREF(__pyx_t_7);
20359 __Pyx_XDECREF(__pyx_t_8);
20360 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20363 __Pyx_XGIVEREF(__pyx_r);
20364 __Pyx_TraceReturn(__pyx_r, 0);
20365 __Pyx_RefNannyFinishContext();
20368 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
20370 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20371 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p;
20373 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20374 o = (*t->tp_alloc)(t, 0);
20376 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20378 if (unlikely(!o))
return 0;
20379 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o);
20380 p->__pyx_vtab = __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
20381 p->parameters = Py_None; Py_INCREF(Py_None);
20382 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_1__cinit__(o, __pyx_empty_tuple, NULL) < 0))
goto bad;
20385 Py_DECREF(o); o = 0;
20389 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o) {
20390 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20391 #if CYTHON_USE_TP_FINALIZE
20392 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20393 if (PyObject_CallFinalizerFromDealloc(o))
return;
20396 PyObject_GC_UnTrack(o);
20398 PyObject *etype, *eval, *etb;
20399 PyErr_Fetch(&etype, &eval, &etb);
20400 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20401 __pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_3__dealloc__(o);
20402 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20403 PyErr_Restore(etype, eval, etb);
20405 Py_CLEAR(p->parameters);
20406 (*Py_TYPE(o)->tp_free)(o);
20409 static int __pyx_tp_traverse_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o, visitproc v,
void *a) {
20411 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20412 if (p->parameters) {
20413 e = (*v)(p->parameters, a);
if (e)
return e;
20418 static int __pyx_tp_clear_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator(PyObject *o) {
20420 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *p = (
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *)o;
20421 tmp = ((PyObject*)p->parameters);
20422 p->parameters = Py_None; Py_INCREF(Py_None);
20427 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator[] = {
20428 {
"get_num_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_4get_num_parameters},
20429 {
"get_data_type_name", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_6get_data_type_name},
20430 {
"set_parameters", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_8set_parameters},
20431 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_14__reduce_cython__},
20432 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_16__setstate_cython__},
20436 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = {
20437 PyVarObject_HEAD_INIT(0, 0)
20438 "imate._c_linear_operator.py_c_linear_operator.pycLinearOperator",
20439 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator),
20441 __pyx_tp_dealloc_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20442 #
if PY_VERSION_HEX < 0x030800b4
20445 #
if PY_VERSION_HEX >= 0x030800b4
20450 #
if PY_MAJOR_VERSION < 3
20453 #
if PY_MAJOR_VERSION >= 3
20466 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20468 __pyx_tp_traverse_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20469 __pyx_tp_clear_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20474 __pyx_methods_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20484 __pyx_tp_new_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator,
20494 #
if PY_VERSION_HEX >= 0x030400a1
20497 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20500 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20503 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20507 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20509 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20510 struct __pyx_array_obj *p;
20512 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20513 o = (*t->tp_alloc)(t, 0);
20515 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20517 if (unlikely(!o))
return 0;
20518 p = ((
struct __pyx_array_obj *)o);
20519 p->__pyx_vtab = __pyx_vtabptr_array;
20520 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20521 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20522 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
20525 Py_DECREF(o); o = 0;
20529 static void __pyx_tp_dealloc_array(PyObject *o) {
20530 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
20531 #if CYTHON_USE_TP_FINALIZE
20532 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
20533 if (PyObject_CallFinalizerFromDealloc(o))
return;
20537 PyObject *etype, *eval, *etb;
20538 PyErr_Fetch(&etype, &eval, &etb);
20539 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20540 __pyx_array___dealloc__(o);
20541 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20542 PyErr_Restore(etype, eval, etb);
20545 Py_CLEAR(p->_format);
20546 (*Py_TYPE(o)->tp_free)(o);
20548 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20550 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20551 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20556 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20558 return __pyx_array___setitem__(o, i, v);
20561 PyErr_Format(PyExc_NotImplementedError,
20562 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20567 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
20568 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
20569 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20571 v = __pyx_array___getattr__(o, n);
20576 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
20577 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
20580 static PyMethodDef __pyx_methods_array[] = {
20581 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
20582 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
20583 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
20587 static struct PyGetSetDef __pyx_getsets_array[] = {
20588 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
20592 static PySequenceMethods __pyx_tp_as_sequence_array = {
20593 __pyx_array___len__,
20596 __pyx_sq_item_array,
20605 static PyMappingMethods __pyx_tp_as_mapping_array = {
20606 __pyx_array___len__,
20607 __pyx_array___getitem__,
20608 __pyx_mp_ass_subscript_array,
20611 static PyBufferProcs __pyx_tp_as_buffer_array = {
20612 #if PY_MAJOR_VERSION < 3
20615 #if PY_MAJOR_VERSION < 3
20618 #if PY_MAJOR_VERSION < 3
20621 #if PY_MAJOR_VERSION < 3
20624 __pyx_array_getbuffer,
20628 static PyTypeObject __pyx_type___pyx_array = {
20629 PyVarObject_HEAD_INIT(0, 0)
20630 "imate._c_linear_operator.py_c_linear_operator.array",
20631 sizeof(
struct __pyx_array_obj),
20633 __pyx_tp_dealloc_array,
20634 #
if PY_VERSION_HEX < 0x030800b4
20637 #
if PY_VERSION_HEX >= 0x030800b4
20642 #
if PY_MAJOR_VERSION < 3
20645 #
if PY_MAJOR_VERSION >= 3
20650 &__pyx_tp_as_sequence_array,
20651 &__pyx_tp_as_mapping_array,
20655 __pyx_tp_getattro_array,
20657 &__pyx_tp_as_buffer_array,
20658 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
20666 __pyx_methods_array,
20668 __pyx_getsets_array,
20676 __pyx_tp_new_array,
20686 #
if PY_VERSION_HEX >= 0x030400a1
20689 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20692 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20695 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20700 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20701 struct __pyx_MemviewEnum_obj *p;
20703 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20704 o = (*t->tp_alloc)(t, 0);
20706 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20708 if (unlikely(!o))
return 0;
20709 p = ((
struct __pyx_MemviewEnum_obj *)o);
20710 p->name = Py_None; Py_INCREF(Py_None);
20714 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20715 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20716 #if CYTHON_USE_TP_FINALIZE
20717 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20718 if (PyObject_CallFinalizerFromDealloc(o))
return;
20721 PyObject_GC_UnTrack(o);
20723 (*Py_TYPE(o)->tp_free)(o);
20726 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
20728 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20730 e = (*v)(p->name, a);
if (e)
return e;
20735 static int __pyx_tp_clear_Enum(PyObject *o) {
20737 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
20738 tmp = ((PyObject*)p->name);
20739 p->name = Py_None; Py_INCREF(Py_None);
20744 static PyMethodDef __pyx_methods_Enum[] = {
20745 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20746 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20750 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20751 PyVarObject_HEAD_INIT(0, 0)
20752 "imate._c_linear_operator.py_c_linear_operator.Enum",
20753 sizeof(
struct __pyx_MemviewEnum_obj),
20755 __pyx_tp_dealloc_Enum,
20756 #
if PY_VERSION_HEX < 0x030800b4
20759 #
if PY_VERSION_HEX >= 0x030800b4
20764 #
if PY_MAJOR_VERSION < 3
20767 #
if PY_MAJOR_VERSION >= 3
20770 __pyx_MemviewEnum___repr__,
20780 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20782 __pyx_tp_traverse_Enum,
20783 __pyx_tp_clear_Enum,
20788 __pyx_methods_Enum,
20796 __pyx_MemviewEnum___init__,
20808 #
if PY_VERSION_HEX >= 0x030400a1
20811 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20814 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20817 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
20821 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20823 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20824 struct __pyx_memoryview_obj *p;
20826 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20827 o = (*t->tp_alloc)(t, 0);
20829 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20831 if (unlikely(!o))
return 0;
20832 p = ((
struct __pyx_memoryview_obj *)o);
20833 p->__pyx_vtab = __pyx_vtabptr_memoryview;
20834 p->obj = Py_None; Py_INCREF(Py_None);
20835 p->_size = Py_None; Py_INCREF(Py_None);
20836 p->_array_interface = Py_None; Py_INCREF(Py_None);
20837 p->view.obj = NULL;
20838 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
20841 Py_DECREF(o); o = 0;
20845 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20846 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20847 #if CYTHON_USE_TP_FINALIZE
20848 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
20849 if (PyObject_CallFinalizerFromDealloc(o))
return;
20852 PyObject_GC_UnTrack(o);
20854 PyObject *etype, *eval, *etb;
20855 PyErr_Fetch(&etype, &eval, &etb);
20856 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20857 __pyx_memoryview___dealloc__(o);
20858 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20859 PyErr_Restore(etype, eval, etb);
20862 Py_CLEAR(p->_size);
20863 Py_CLEAR(p->_array_interface);
20864 (*Py_TYPE(o)->tp_free)(o);
20867 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
20869 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20871 e = (*v)(p->obj, a);
if (e)
return e;
20874 e = (*v)(p->_size, a);
if (e)
return e;
20876 if (p->_array_interface) {
20877 e = (*v)(p->_array_interface, a);
if (e)
return e;
20880 e = (*v)(p->view.obj, a);
if (e)
return e;
20885 static int __pyx_tp_clear_memoryview(PyObject *o) {
20887 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
20888 tmp = ((PyObject*)p->obj);
20889 p->obj = Py_None; Py_INCREF(Py_None);
20891 tmp = ((PyObject*)p->_size);
20892 p->_size = Py_None; Py_INCREF(Py_None);
20894 tmp = ((PyObject*)p->_array_interface);
20895 p->_array_interface = Py_None; Py_INCREF(Py_None);
20897 Py_CLEAR(p->view.obj);
20900 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20902 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
20903 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20908 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20910 return __pyx_memoryview___setitem__(o, i, v);
20913 PyErr_Format(PyExc_NotImplementedError,
20914 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20919 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
20920 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20923 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
20924 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20927 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
20928 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20931 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
20932 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20935 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
20936 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20939 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
20940 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20943 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
20944 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20947 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
20948 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20951 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
20952 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20955 static PyMethodDef __pyx_methods_memoryview[] = {
20956 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20957 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20958 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20959 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20960 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20961 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20965 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20966 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
20967 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
20968 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
20969 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
20970 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
20971 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
20972 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
20973 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
20974 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
20978 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20979 __pyx_memoryview___len__,
20982 __pyx_sq_item_memoryview,
20991 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20992 __pyx_memoryview___len__,
20993 __pyx_memoryview___getitem__,
20994 __pyx_mp_ass_subscript_memoryview,
20997 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20998 #if PY_MAJOR_VERSION < 3
21001 #if PY_MAJOR_VERSION < 3
21004 #if PY_MAJOR_VERSION < 3
21007 #if PY_MAJOR_VERSION < 3
21010 __pyx_memoryview_getbuffer,
21014 static PyTypeObject __pyx_type___pyx_memoryview = {
21015 PyVarObject_HEAD_INIT(0, 0)
21016 "imate._c_linear_operator.py_c_linear_operator.memoryview",
21017 sizeof(
struct __pyx_memoryview_obj),
21019 __pyx_tp_dealloc_memoryview,
21020 #
if PY_VERSION_HEX < 0x030800b4
21023 #
if PY_VERSION_HEX >= 0x030800b4
21028 #
if PY_MAJOR_VERSION < 3
21031 #
if PY_MAJOR_VERSION >= 3
21034 __pyx_memoryview___repr__,
21036 &__pyx_tp_as_sequence_memoryview,
21037 &__pyx_tp_as_mapping_memoryview,
21040 __pyx_memoryview___str__,
21043 &__pyx_tp_as_buffer_memoryview,
21044 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21046 __pyx_tp_traverse_memoryview,
21047 __pyx_tp_clear_memoryview,
21052 __pyx_methods_memoryview,
21054 __pyx_getsets_memoryview,
21062 __pyx_tp_new_memoryview,
21072 #
if PY_VERSION_HEX >= 0x030400a1
21075 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21078 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21081 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21085 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21087 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21088 struct __pyx_memoryviewslice_obj *p;
21089 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21090 if (unlikely(!o))
return 0;
21091 p = ((
struct __pyx_memoryviewslice_obj *)o);
21092 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21093 p->from_object = Py_None; Py_INCREF(Py_None);
21094 p->from_slice.memview = NULL;
21098 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21099 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21100 #if CYTHON_USE_TP_FINALIZE
21101 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
21102 if (PyObject_CallFinalizerFromDealloc(o))
return;
21105 PyObject_GC_UnTrack(o);
21107 PyObject *etype, *eval, *etb;
21108 PyErr_Fetch(&etype, &eval, &etb);
21109 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21110 __pyx_memoryviewslice___dealloc__(o);
21111 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21112 PyErr_Restore(etype, eval, etb);
21114 Py_CLEAR(p->from_object);
21115 PyObject_GC_Track(o);
21116 __pyx_tp_dealloc_memoryview(o);
21119 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21121 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21122 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21123 if (p->from_object) {
21124 e = (*v)(p->from_object, a);
if (e)
return e;
21129 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21131 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21132 __pyx_tp_clear_memoryview(o);
21133 tmp = ((PyObject*)p->from_object);
21134 p->from_object = Py_None; Py_INCREF(Py_None);
21136 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21140 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21141 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21144 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21145 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21146 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21150 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21151 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21155 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21156 PyVarObject_HEAD_INIT(0, 0)
21157 "imate._c_linear_operator.py_c_linear_operator._memoryviewslice",
21158 sizeof(
struct __pyx_memoryviewslice_obj),
21160 __pyx_tp_dealloc__memoryviewslice,
21161 #
if PY_VERSION_HEX < 0x030800b4
21164 #
if PY_VERSION_HEX >= 0x030800b4
21169 #
if PY_MAJOR_VERSION < 3
21172 #
if PY_MAJOR_VERSION >= 3
21175 #
if CYTHON_COMPILING_IN_PYPY
21176 __pyx_memoryview___repr__,
21185 #
if CYTHON_COMPILING_IN_PYPY
21186 __pyx_memoryview___str__,
21193 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21194 "Internal class for passing memoryview slices to Python",
21195 __pyx_tp_traverse__memoryviewslice,
21196 __pyx_tp_clear__memoryviewslice,
21201 __pyx_methods__memoryviewslice,
21203 __pyx_getsets__memoryviewslice,
21211 __pyx_tp_new__memoryviewslice,
21221 #
if PY_VERSION_HEX >= 0x030400a1
21224 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21227 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21230 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
21235 static PyMethodDef __pyx_methods[] = {
21239 #if PY_MAJOR_VERSION >= 3
21240 #if CYTHON_PEP489_MULTI_PHASE_INIT
21241 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
21242 static int __pyx_pymod_exec_py_c_linear_operator(PyObject* module);
21243 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21244 {Py_mod_create, (
void*)__pyx_pymod_create},
21245 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_linear_operator},
21250 static struct PyModuleDef __pyx_moduledef = {
21251 PyModuleDef_HEAD_INIT,
21252 "py_c_linear_operator",
21254 #if CYTHON_PEP489_MULTI_PHASE_INIT
21260 #if CYTHON_PEP489_MULTI_PHASE_INIT
21261 __pyx_moduledef_slots,
21270 #ifndef CYTHON_SMALL_CODE
21271 #if defined(__clang__)
21272 #define CYTHON_SMALL_CODE
21273 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21274 #define CYTHON_SMALL_CODE __attribute__((cold))
21276 #define CYTHON_SMALL_CODE
21280 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21281 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21282 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21283 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21284 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21285 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21286 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21287 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21288 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21289 {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0,
sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
21290 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21291 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21292 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21293 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21294 {&__pyx_kp_u_LinearOperator_object_is_s, __pyx_k_LinearOperator_object_is_s,
sizeof(__pyx_k_LinearOperator_object_is_s), 0, 1, 0, 0},
21295 {&__pyx_kp_u_Linear_operator_data_type_is_not, __pyx_k_Linear_operator_data_type_is_not,
sizeof(__pyx_k_Linear_operator_data_type_is_not), 0, 1, 0, 0},
21296 {&__pyx_kp_u_Linear_operator_double_type_is_n, __pyx_k_Linear_operator_double_type_is_n,
sizeof(__pyx_k_Linear_operator_double_type_is_n), 0, 1, 0, 0},
21297 {&__pyx_kp_u_Linear_operator_float_type_is_no, __pyx_k_Linear_operator_float_type_is_no,
sizeof(__pyx_k_Linear_operator_float_type_is_no), 0, 1, 0, 0},
21298 {&__pyx_kp_u_Linear_operator_is_not_set, __pyx_k_Linear_operator_is_not_set,
sizeof(__pyx_k_Linear_operator_is_not_set), 0, 1, 0, 0},
21299 {&__pyx_kp_u_Linear_operator_long_double_type, __pyx_k_Linear_operator_long_double_type,
sizeof(__pyx_k_Linear_operator_long_double_type), 0, 1, 0, 0},
21300 {&__pyx_kp_u_LongIndexType_has_an_unconventi, __pyx_k_LongIndexType_has_an_unconventi,
sizeof(__pyx_k_LongIndexType_has_an_unconventi), 0, 1, 0, 0},
21301 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21302 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21303 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21304 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
21305 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21306 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21307 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
21308 {&__pyx_kp_u_The_input_vector_and_product_sho, __pyx_k_The_input_vector_and_product_sho,
sizeof(__pyx_k_The_input_vector_and_product_sho), 0, 1, 0, 0},
21309 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21310 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21311 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21312 {&__pyx_kp_u_Vector_type_should_be_either_flo, __pyx_k_Vector_type_should_be_either_flo,
sizeof(__pyx_k_Vector_type_should_be_either_flo), 0, 1, 0, 0},
21313 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21314 {&__pyx_kp_u_Wrong_accessors_is_called_The_ty, __pyx_k_Wrong_accessors_is_called_The_ty,
sizeof(__pyx_k_Wrong_accessors_is_called_The_ty), 0, 1, 0, 0},
21315 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21316 {&__pyx_n_s_array, __pyx_k_array,
sizeof(__pyx_k_array), 0, 0, 1, 1},
21317 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
21318 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
21319 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
21320 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
21321 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
21322 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21323 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21324 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21325 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
21326 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
21327 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
21328 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21329 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
21330 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21331 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
21332 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
21333 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
21334 {&__pyx_n_u_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 1, 0, 1},
21335 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
21336 {&__pyx_n_u_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 1, 0, 1},
21337 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
21338 {&__pyx_n_u_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 1, 0, 1},
21339 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
21340 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21341 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21342 {&__pyx_n_s_get_data_type_name, __pyx_k_get_data_type_name,
sizeof(__pyx_k_get_data_type_name), 0, 0, 1, 1},
21343 {&__pyx_n_s_get_num_parameters, __pyx_k_get_num_parameters,
sizeof(__pyx_k_get_num_parameters), 0, 0, 1, 1},
21344 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21345 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21346 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
21347 {&__pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_k_imate__c_linear_operator_py_c_li,
sizeof(__pyx_k_imate__c_linear_operator_py_c_li), 0, 0, 1, 0},
21348 {&__pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_k_imate__c_linear_operator_py_c_li_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_li_2), 0, 0, 1, 1},
21349 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
21350 {&__pyx_n_s_isscalar, __pyx_k_isscalar,
sizeof(__pyx_k_isscalar), 0, 0, 1, 1},
21351 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21352 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21353 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
21354 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
21355 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
21356 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
21357 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21358 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21359 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
21360 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21361 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21362 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
21363 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
21364 {&__pyx_n_s_parameters, __pyx_k_parameters,
sizeof(__pyx_k_parameters), 0, 0, 1, 1},
21365 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21366 {&__pyx_n_s_product, __pyx_k_product,
sizeof(__pyx_k_product), 0, 0, 1, 1},
21367 {&__pyx_n_s_pycLinearOperator, __pyx_k_pycLinearOperator,
sizeof(__pyx_k_pycLinearOperator), 0, 0, 1, 1},
21368 {&__pyx_n_s_pycLinearOperator___reduce_cytho, __pyx_k_pycLinearOperator___reduce_cytho,
sizeof(__pyx_k_pycLinearOperator___reduce_cytho), 0, 0, 1, 1},
21369 {&__pyx_n_s_pycLinearOperator___setstate_cyt, __pyx_k_pycLinearOperator___setstate_cyt,
sizeof(__pyx_k_pycLinearOperator___setstate_cyt), 0, 0, 1, 1},
21370 {&__pyx_n_s_pycLinearOperator_dot, __pyx_k_pycLinearOperator_dot,
sizeof(__pyx_k_pycLinearOperator_dot), 0, 0, 1, 1},
21371 {&__pyx_n_s_pycLinearOperator_get_data_type, __pyx_k_pycLinearOperator_get_data_type,
sizeof(__pyx_k_pycLinearOperator_get_data_type), 0, 0, 1, 1},
21372 {&__pyx_n_s_pycLinearOperator_get_num_parame, __pyx_k_pycLinearOperator_get_num_parame,
sizeof(__pyx_k_pycLinearOperator_get_num_parame), 0, 0, 1, 1},
21373 {&__pyx_n_s_pycLinearOperator_set_parameters, __pyx_k_pycLinearOperator_set_parameters,
sizeof(__pyx_k_pycLinearOperator_set_parameters), 0, 0, 1, 1},
21374 {&__pyx_n_s_pycLinearOperator_transpose_dot, __pyx_k_pycLinearOperator_transpose_dot,
sizeof(__pyx_k_pycLinearOperator_transpose_dot), 0, 0, 1, 1},
21375 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21376 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21377 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21378 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21379 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21380 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21381 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21382 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21383 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
21384 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21385 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21386 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21387 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
21388 {&__pyx_n_s_set_parameters, __pyx_k_set_parameters,
sizeof(__pyx_k_set_parameters), 0, 0, 1, 1},
21389 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21390 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21391 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
21392 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
21393 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
21394 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
21395 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
21396 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21397 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21398 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21399 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21400 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
21401 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
21402 {&__pyx_n_s_transpose_dot, __pyx_k_transpose_dot,
sizeof(__pyx_k_transpose_dot), 0, 0, 1, 1},
21403 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21404 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21405 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21406 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
21407 {&__pyx_n_s_vector, __pyx_k_vector,
sizeof(__pyx_k_vector), 0, 0, 1, 1},
21408 {0, 0, 0, 0, 0, 0, 0}
21410 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
21411 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 67, __pyx_L1_error)
21412 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 107, __pyx_L1_error)
21413 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 158, __pyx_L1_error)
21414 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
21415 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
21416 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 181, __pyx_L1_error)
21417 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
21418 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
21419 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
21425 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
21426 __Pyx_RefNannyDeclarations
21427 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
21436 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_LongIndexType_has_an_unconventi);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 67, __pyx_L1_error)
21437 __Pyx_GOTREF(__pyx_tuple_);
21438 __Pyx_GIVEREF(__pyx_tuple_);
21447 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_is_not_set);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 107, __pyx_L1_error)
21448 __Pyx_GOTREF(__pyx_tuple__2);
21449 __Pyx_GIVEREF(__pyx_tuple__2);
21458 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_data_type_is_not);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 158, __pyx_L1_error)
21459 __Pyx_GOTREF(__pyx_tuple__5);
21460 __Pyx_GIVEREF(__pyx_tuple__5);
21469 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_float_type_is_no);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 171, __pyx_L1_error)
21470 __Pyx_GOTREF(__pyx_tuple__6);
21471 __Pyx_GIVEREF(__pyx_tuple__6);
21480 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_double_type_is_n);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 189, __pyx_L1_error)
21481 __Pyx_GOTREF(__pyx_tuple__7);
21482 __Pyx_GIVEREF(__pyx_tuple__7);
21491 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Linear_operator_long_double_type);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 208, __pyx_L1_error)
21492 __Pyx_GOTREF(__pyx_tuple__8);
21493 __Pyx_GIVEREF(__pyx_tuple__8);
21502 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_The_input_vector_and_product_sho);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 243, __pyx_L1_error)
21503 __Pyx_GOTREF(__pyx_tuple__11);
21504 __Pyx_GIVEREF(__pyx_tuple__11);
21513 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Vector_type_should_be_either_flo);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 335, __pyx_L1_error)
21514 __Pyx_GOTREF(__pyx_tuple__12);
21515 __Pyx_GIVEREF(__pyx_tuple__12);
21523 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
21524 __Pyx_GOTREF(__pyx_tuple__15);
21525 __Pyx_GIVEREF(__pyx_tuple__15);
21532 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
21533 __Pyx_GOTREF(__pyx_tuple__17);
21534 __Pyx_GIVEREF(__pyx_tuple__17);
21543 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 134, __pyx_L1_error)
21544 __Pyx_GOTREF(__pyx_tuple__18);
21545 __Pyx_GIVEREF(__pyx_tuple__18);
21554 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 137, __pyx_L1_error)
21555 __Pyx_GOTREF(__pyx_tuple__19);
21556 __Pyx_GIVEREF(__pyx_tuple__19);
21565 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 149, __pyx_L1_error)
21566 __Pyx_GOTREF(__pyx_tuple__20);
21567 __Pyx_GIVEREF(__pyx_tuple__20);
21576 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 177, __pyx_L1_error)
21577 __Pyx_GOTREF(__pyx_tuple__21);
21578 __Pyx_GIVEREF(__pyx_tuple__21);
21587 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 193, __pyx_L1_error)
21588 __Pyx_GOTREF(__pyx_tuple__22);
21589 __Pyx_GIVEREF(__pyx_tuple__22);
21597 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
21598 __Pyx_GOTREF(__pyx_tuple__23);
21599 __Pyx_GIVEREF(__pyx_tuple__23);
21606 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
21607 __Pyx_GOTREF(__pyx_tuple__24);
21608 __Pyx_GIVEREF(__pyx_tuple__24);
21617 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 420, __pyx_L1_error)
21618 __Pyx_GOTREF(__pyx_tuple__25);
21619 __Pyx_GIVEREF(__pyx_tuple__25);
21628 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 497, __pyx_L1_error)
21629 __Pyx_GOTREF(__pyx_tuple__26);
21630 __Pyx_GIVEREF(__pyx_tuple__26);
21639 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 522, __pyx_L1_error)
21640 __Pyx_GOTREF(__pyx_tuple__27);
21641 __Pyx_GIVEREF(__pyx_tuple__27);
21650 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 572, __pyx_L1_error)
21651 __Pyx_GOTREF(__pyx_tuple__28);
21652 __Pyx_GIVEREF(__pyx_tuple__28);
21661 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 579, __pyx_L1_error)
21662 __Pyx_GOTREF(__pyx_tuple__29);
21663 __Pyx_INCREF(__pyx_int_neg_1);
21664 __Pyx_GIVEREF(__pyx_int_neg_1);
21665 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
21666 __Pyx_GIVEREF(__pyx_tuple__29);
21674 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
21675 __Pyx_GOTREF(__pyx_tuple__30);
21676 __Pyx_GIVEREF(__pyx_tuple__30);
21683 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
21684 __Pyx_GOTREF(__pyx_tuple__31);
21685 __Pyx_GIVEREF(__pyx_tuple__31);
21694 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 684, __pyx_L1_error)
21695 __Pyx_GOTREF(__pyx_slice__32);
21696 __Pyx_GIVEREF(__pyx_slice__32);
21705 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 705, __pyx_L1_error)
21706 __Pyx_GOTREF(__pyx_tuple__33);
21707 __Pyx_GIVEREF(__pyx_tuple__33);
21715 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
21716 __Pyx_GOTREF(__pyx_tuple__34);
21717 __Pyx_GIVEREF(__pyx_tuple__34);
21724 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
21725 __Pyx_GOTREF(__pyx_tuple__35);
21726 __Pyx_GIVEREF(__pyx_tuple__35);
21727 __pyx_tuple__37 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 4, __pyx_L1_error)
21728 __Pyx_GOTREF(__pyx_tuple__37);
21729 __Pyx_GIVEREF(__pyx_tuple__37);
21738 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 133, __pyx_L1_error)
21739 __Pyx_GOTREF(__pyx_tuple__38);
21740 __Pyx_GIVEREF(__pyx_tuple__38);
21741 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_get_num_parameters, 133, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 133, __pyx_L1_error)
21750 __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 153, __pyx_L1_error)
21751 __Pyx_GOTREF(__pyx_tuple__39);
21752 __Pyx_GIVEREF(__pyx_tuple__39);
21753 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_get_data_type_name, 153, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 153, __pyx_L1_error)
21762 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_parameters);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 222, __pyx_L1_error)
21763 __Pyx_GOTREF(__pyx_tuple__40);
21764 __Pyx_GIVEREF(__pyx_tuple__40);
21765 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_set_parameters, 222, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 222, __pyx_L1_error)
21774 __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_vector, __pyx_n_s_product);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 238, __pyx_L1_error)
21775 __Pyx_GOTREF(__pyx_tuple__41);
21776 __Pyx_GIVEREF(__pyx_tuple__41);
21777 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_dot, 238, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 238, __pyx_L1_error)
21786 __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_vector, __pyx_n_s_product);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 342, __pyx_L1_error)
21787 __Pyx_GOTREF(__pyx_tuple__42);
21788 __Pyx_GIVEREF(__pyx_tuple__42);
21789 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_li, __pyx_n_s_transpose_dot, 342, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 342, __pyx_L1_error)
21796 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 1, __pyx_L1_error)
21797 __Pyx_GOTREF(__pyx_tuple__43);
21798 __Pyx_GIVEREF(__pyx_tuple__43);
21799 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
21807 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 3, __pyx_L1_error)
21808 __Pyx_GOTREF(__pyx_tuple__44);
21809 __Pyx_GIVEREF(__pyx_tuple__44);
21810 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
21819 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 287, __pyx_L1_error)
21820 __Pyx_GOTREF(__pyx_tuple__45);
21821 __Pyx_GIVEREF(__pyx_tuple__45);
21830 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 288, __pyx_L1_error)
21831 __Pyx_GOTREF(__pyx_tuple__46);
21832 __Pyx_GIVEREF(__pyx_tuple__46);
21841 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 289, __pyx_L1_error)
21842 __Pyx_GOTREF(__pyx_tuple__47);
21843 __Pyx_GIVEREF(__pyx_tuple__47);
21852 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 292, __pyx_L1_error)
21853 __Pyx_GOTREF(__pyx_tuple__48);
21854 __Pyx_GIVEREF(__pyx_tuple__48);
21863 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 293, __pyx_L1_error)
21864 __Pyx_GOTREF(__pyx_tuple__49);
21865 __Pyx_GIVEREF(__pyx_tuple__49);
21872 __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 1, __pyx_L1_error)
21873 __Pyx_GOTREF(__pyx_tuple__50);
21874 __Pyx_GIVEREF(__pyx_tuple__50);
21875 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
21876 __Pyx_RefNannyFinishContext();
21879 __Pyx_RefNannyFinishContext();
21883 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
21885 __Pyx_init_assertions_enabled();
21887 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21889 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21890 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
21891 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21892 __pyx_int_112105877 = PyInt_FromLong(112105877L);
if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21893 __pyx_int_136983863 = PyInt_FromLong(136983863L);
if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21894 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
21895 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21901 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
21902 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
21903 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
21904 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
21905 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
21906 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
21907 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
21909 static int __Pyx_modinit_global_init_code(
void) {
21910 __Pyx_RefNannyDeclarations
21911 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
21913 generic = Py_None; Py_INCREF(Py_None);
21914 strided = Py_None; Py_INCREF(Py_None);
21915 indirect = Py_None; Py_INCREF(Py_None);
21916 contiguous = Py_None; Py_INCREF(Py_None);
21917 indirect_contiguous = Py_None; Py_INCREF(Py_None);
21918 __Pyx_RefNannyFinishContext();
21922 static int __Pyx_modinit_variable_export_code(
void) {
21923 __Pyx_RefNannyDeclarations
21924 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
21926 __Pyx_RefNannyFinishContext();
21930 static int __Pyx_modinit_function_export_code(
void) {
21931 __Pyx_RefNannyDeclarations
21932 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
21934 __Pyx_RefNannyFinishContext();
21938 static int __Pyx_modinit_type_init_code(
void) {
21939 __Pyx_RefNannyDeclarations
21940 int __pyx_lineno = 0;
21941 const char *__pyx_filename = NULL;
21942 int __pyx_clineno = 0;
21943 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
21945 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = &__pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
21946 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_num_rows = (
LongIndexType (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_rows;
21947 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_num_columns = (
LongIndexType (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_num_columns;
21948 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_float = (
cLinearOperator<float> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_float;
21949 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_double = (
cLinearOperator<double> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_double;
21950 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.get_linear_operator_long_double = (
cLinearOperator<long double> *(*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_get_linear_operator_long_double;
21951 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.dot = (void (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_dot;
21952 __pyx_vtable_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.transpose_dot = (void (*)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch))__pyx_f_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_transpose_dot;
21953 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
21954 #if PY_VERSION_HEX < 0x030800B1
21955 __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_print = 0;
21957 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_getattro == PyObject_GenericGetAttr)) {
21958 __pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21960 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
21961 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycLinearOperator, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
21962 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
21963 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = &__pyx_type_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
21964 __pyx_vtabptr_array = &__pyx_vtable_array;
21965 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
21966 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
21967 #if PY_VERSION_HEX < 0x030800B1
21968 __pyx_type___pyx_array.tp_print = 0;
21970 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
21971 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
21972 __pyx_array_type = &__pyx_type___pyx_array;
21973 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
21974 #if PY_VERSION_HEX < 0x030800B1
21975 __pyx_type___pyx_MemviewEnum.tp_print = 0;
21977 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21978 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21980 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
21981 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21982 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21983 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21984 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21985 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21986 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21987 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21988 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
21989 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21990 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
21991 #if PY_VERSION_HEX < 0x030800B1
21992 __pyx_type___pyx_memoryview.tp_print = 0;
21994 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21995 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21997 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
21998 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
21999 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22000 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22001 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22002 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22003 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22004 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22005 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22006 #if PY_VERSION_HEX < 0x030800B1
22007 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22009 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22010 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22012 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22013 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
22014 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22015 __Pyx_RefNannyFinishContext();
22018 __Pyx_RefNannyFinishContext();
22022 static int __Pyx_modinit_type_import_code(
void) {
22023 __Pyx_RefNannyDeclarations
22024 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22026 __Pyx_RefNannyFinishContext();
22030 static int __Pyx_modinit_variable_import_code(
void) {
22031 __Pyx_RefNannyDeclarations
22032 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22034 __Pyx_RefNannyFinishContext();
22038 static int __Pyx_modinit_function_import_code(
void) {
22039 __Pyx_RefNannyDeclarations
22040 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22042 __Pyx_RefNannyFinishContext();
22047 #ifndef CYTHON_NO_PYINIT_EXPORT
22048 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22049 #elif PY_MAJOR_VERSION < 3
22051 #define __Pyx_PyMODINIT_FUNC extern "C" void
22053 #define __Pyx_PyMODINIT_FUNC void
22057 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22059 #define __Pyx_PyMODINIT_FUNC PyObject *
22064 #if PY_MAJOR_VERSION < 3
22065 __Pyx_PyMODINIT_FUNC initpy_c_linear_operator(
void) CYTHON_SMALL_CODE;
22066 __Pyx_PyMODINIT_FUNC initpy_c_linear_operator(
void)
22068 __Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(
void) CYTHON_SMALL_CODE;
22069 __Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(
void)
22070 #if CYTHON_PEP489_MULTI_PHASE_INIT
22072 return PyModuleDef_Init(&__pyx_moduledef);
22074 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22075 #if PY_VERSION_HEX >= 0x030700A1
22076 static PY_INT64_T main_interpreter_id = -1;
22077 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22078 if (main_interpreter_id == -1) {
22079 main_interpreter_id = current_id;
22080 return (unlikely(current_id == -1)) ? -1 : 0;
22081 }
else if (unlikely(main_interpreter_id != current_id))
22083 static PyInterpreterState *main_interpreter = NULL;
22084 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22085 if (!main_interpreter) {
22086 main_interpreter = current_interpreter;
22087 }
else if (unlikely(main_interpreter != current_interpreter))
22092 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22097 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22098 PyObject *value = PyObject_GetAttrString(spec, from_name);
22100 if (likely(value)) {
22101 if (allow_none || value != Py_None) {
22102 result = PyDict_SetItemString(moddict, to_name, value);
22105 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22112 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22113 PyObject *module = NULL, *moddict, *modname;
22114 if (__Pyx_check_single_interpreter())
22117 return __Pyx_NewRef(__pyx_m);
22118 modname = PyObject_GetAttrString(spec,
"name");
22119 if (unlikely(!modname))
goto bad;
22120 module = PyModule_NewObject(modname);
22121 Py_DECREF(modname);
22122 if (unlikely(!module))
goto bad;
22123 moddict = PyModule_GetDict(module);
22124 if (unlikely(!moddict))
goto bad;
22125 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22126 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22127 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22128 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22131 Py_XDECREF(module);
22136 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_linear_operator(PyObject *__pyx_pyinit_module)
22140 __Pyx_TraceDeclarations
22141 PyObject *__pyx_t_1 = NULL;
22142 static PyThread_type_lock __pyx_t_2[8];
22143 int __pyx_lineno = 0;
22144 const char *__pyx_filename = NULL;
22145 int __pyx_clineno = 0;
22146 __Pyx_RefNannyDeclarations
22147 #if CYTHON_PEP489_MULTI_PHASE_INIT
22149 if (__pyx_m == __pyx_pyinit_module)
return 0;
22150 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_linear_operator' has already been imported. Re-initialisation is not supported.");
22153 #elif PY_MAJOR_VERSION >= 3
22154 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22156 #if CYTHON_REFNANNY
22157 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22158 if (!__Pyx_RefNanny) {
22160 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22161 if (!__Pyx_RefNanny)
22162 Py_FatalError(
"failed to import 'refnanny' module");
22165 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(void)", 0);
22166 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22167 #ifdef __Pxy_PyFrame_Initialize_Offsets
22168 __Pxy_PyFrame_Initialize_Offsets();
22170 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22171 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22172 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22173 #ifdef __Pyx_CyFunction_USED
22174 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22176 #ifdef __Pyx_FusedFunction_USED
22177 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22179 #ifdef __Pyx_Coroutine_USED
22180 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22182 #ifdef __Pyx_Generator_USED
22183 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22185 #ifdef __Pyx_AsyncGen_USED
22186 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22188 #ifdef __Pyx_StopAsyncIteration_USED
22189 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22193 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22194 PyEval_InitThreads();
22197 #if CYTHON_PEP489_MULTI_PHASE_INIT
22198 __pyx_m = __pyx_pyinit_module;
22199 Py_INCREF(__pyx_m);
22201 #if PY_MAJOR_VERSION < 3
22202 __pyx_m = Py_InitModule4(
"py_c_linear_operator", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22204 __pyx_m = PyModule_Create(&__pyx_moduledef);
22206 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22208 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22209 Py_INCREF(__pyx_d);
22210 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22211 Py_INCREF(__pyx_b);
22212 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22213 Py_INCREF(__pyx_cython_runtime);
22214 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22216 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22217 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22218 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22220 if (__pyx_module_is_main_imate___c_linear_operator__py_c_linear_operator) {
22221 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22223 #if PY_MAJOR_VERSION >= 3
22225 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22226 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_linear_operator")) {
22227 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_linear_operator", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22232 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22234 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22236 (void)__Pyx_modinit_global_init_code();
22237 (void)__Pyx_modinit_variable_export_code();
22238 (void)__Pyx_modinit_function_export_code();
22239 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22240 (void)__Pyx_modinit_type_import_code();
22241 (void)__Pyx_modinit_variable_import_code();
22242 (void)__Pyx_modinit_function_import_code();
22244 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22245 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22247 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_linear_operator(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22256 __Pyx_TraceLine(14,0,__PYX_ERR(0, 14, __pyx_L1_error))
22257 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
22258 __Pyx_GOTREF(__pyx_t_1);
22259 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
22260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22269 __Pyx_TraceLine(93,0,__PYX_ERR(0, 93, __pyx_L1_error))
22279 __Pyx_TraceLine(113,0,__PYX_ERR(0, 113, __pyx_L1_error))
22289 __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
22290 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_5get_num_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_get_num_parame, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__3));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
22291 __Pyx_GOTREF(__pyx_t_1);
22292 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_get_num_parameters, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
22293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22294 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22303 __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
22304 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_7get_data_type_name, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_get_data_type, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
22305 __Pyx_GOTREF(__pyx_t_1);
22306 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_get_data_type_name, __pyx_t_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
22307 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22308 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22317 __Pyx_TraceLine(166,0,__PYX_ERR(0, 166, __pyx_L1_error))
22327 __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
22337 __Pyx_TraceLine(202,0,__PYX_ERR(0, 202, __pyx_L1_error))
22347 __Pyx_TraceLine(222,0,__PYX_ERR(0, 222, __pyx_L1_error))
22348 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_9set_parameters, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_set_parameters, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
22349 __Pyx_GOTREF(__pyx_t_1);
22350 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_set_parameters, __pyx_t_1) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
22351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22352 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22361 __Pyx_TraceLine(238,0,__PYX_ERR(0, 238, __pyx_L1_error))
22363 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_11dot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_dot, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
22364 __Pyx_GOTREF(__pyx_t_1);
22365 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_dot, __pyx_t_1) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
22366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22367 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22376 __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
22378 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_13transpose_dot, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator_transpose_dot, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
22379 __Pyx_GOTREF(__pyx_t_1);
22380 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict, __pyx_n_s_transpose_dot, __pyx_t_1) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
22381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22382 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator);
22389 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
22390 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator___reduce_cytho, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22391 __Pyx_GOTREF(__pyx_t_1);
22392 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22401 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
22402 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_20py_c_linear_operator_17pycLinearOperator_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycLinearOperator___setstate_cyt, NULL, __pyx_n_s_imate__c_linear_operator_py_c_li_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
22403 __Pyx_GOTREF(__pyx_t_1);
22404 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
22405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22412 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
22413 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22414 __Pyx_GOTREF(__pyx_t_1);
22415 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22425 __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
22426 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 210, __pyx_L1_error)
22427 __Pyx_GOTREF(__pyx_t_1);
22428 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
22429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22430 PyType_Modified(__pyx_array_type);
22439 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
22449 __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
22459 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
22460 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
22461 __Pyx_GOTREF(__pyx_t_1);
22462 __Pyx_XGOTREF(
generic);
22463 __Pyx_DECREF_SET(
generic, __pyx_t_1);
22464 __Pyx_GIVEREF(__pyx_t_1);
22474 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
22475 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
22476 __Pyx_GOTREF(__pyx_t_1);
22477 __Pyx_XGOTREF(strided);
22478 __Pyx_DECREF_SET(strided, __pyx_t_1);
22479 __Pyx_GIVEREF(__pyx_t_1);
22489 __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
22490 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error)
22491 __Pyx_GOTREF(__pyx_t_1);
22492 __Pyx_XGOTREF(indirect);
22493 __Pyx_DECREF_SET(indirect, __pyx_t_1);
22494 __Pyx_GIVEREF(__pyx_t_1);
22504 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
22505 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
22506 __Pyx_GOTREF(__pyx_t_1);
22507 __Pyx_XGOTREF(contiguous);
22508 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
22509 __Pyx_GIVEREF(__pyx_t_1);
22519 __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
22520 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error)
22521 __Pyx_GOTREF(__pyx_t_1);
22522 __Pyx_XGOTREF(indirect_contiguous);
22523 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
22524 __Pyx_GIVEREF(__pyx_t_1);
22534 __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
22544 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
22545 __pyx_memoryview_thread_locks_used = 0;
22554 __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
22555 __pyx_t_2[0] = PyThread_allocate_lock();
22556 __pyx_t_2[1] = PyThread_allocate_lock();
22557 __pyx_t_2[2] = PyThread_allocate_lock();
22558 __pyx_t_2[3] = PyThread_allocate_lock();
22559 __pyx_t_2[4] = PyThread_allocate_lock();
22560 __pyx_t_2[5] = PyThread_allocate_lock();
22561 __pyx_t_2[6] = PyThread_allocate_lock();
22562 __pyx_t_2[7] = PyThread_allocate_lock();
22563 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
22572 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
22582 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
22592 __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
22602 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
22612 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
22622 __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
22632 __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
22642 __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
22643 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 551, __pyx_L1_error)
22644 __Pyx_GOTREF(__pyx_t_1);
22645 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
22646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22647 PyType_Modified(__pyx_memoryview_type);
22656 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
22666 __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
22676 __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
22686 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
22696 __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
22706 __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
22716 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
22726 __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
22736 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
22746 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
22756 __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
22757 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 997, __pyx_L1_error)
22758 __Pyx_GOTREF(__pyx_t_1);
22759 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
22760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22761 PyType_Modified(__pyx_memoryviewslice_type);
22770 __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
22780 __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
22790 __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
22800 __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
22810 __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
22820 __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
22830 __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
22840 __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
22850 __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
22860 __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
22870 __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
22880 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
22890 __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
22900 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
22910 __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
22920 __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
22930 __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
22940 __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
22950 __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
22960 __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
22970 __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
22978 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
22979 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22980 __Pyx_GOTREF(__pyx_t_1);
22981 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22991 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
22993 __Pyx_TraceReturn(Py_None, 0);
22999 __Pyx_XDECREF(__pyx_t_1);
23002 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_linear_operator", __pyx_clineno, __pyx_lineno, __pyx_filename);
23005 }
else if (!PyErr_Occurred()) {
23006 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_linear_operator");
23009 __Pyx_RefNannyFinishContext();
23010 #if CYTHON_PEP489_MULTI_PHASE_INIT
23011 return (__pyx_m != NULL) ? 0 : -1;
23012 #elif PY_MAJOR_VERSION >= 3
23021 #if CYTHON_REFNANNY
23022 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23023 PyObject *m = NULL, *p = NULL;
23025 m = PyImport_ImportModule(modname);
23027 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23029 r = PyLong_AsVoidPtr(p);
23033 return (__Pyx_RefNannyAPIStruct *)r;
23038 #if CYTHON_USE_TYPE_SLOTS
23039 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23040 PyTypeObject* tp = Py_TYPE(obj);
23041 if (likely(tp->tp_getattro))
23042 return tp->tp_getattro(obj, attr_name);
23043 #if PY_MAJOR_VERSION < 3
23044 if (likely(tp->tp_getattr))
23045 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23047 return PyObject_GetAttr(obj, attr_name);
23052 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23053 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23054 if (unlikely(!result)) {
23055 PyErr_Format(PyExc_NameError,
23056 #
if PY_MAJOR_VERSION >= 3
23057 "name '%U' is not defined", name);
23059 "name '%.200s' is not defined", PyString_AS_STRING(name));
23066 static void __Pyx_RaiseArgtupleInvalid(
23067 const char* func_name,
23069 Py_ssize_t num_min,
23070 Py_ssize_t num_max,
23071 Py_ssize_t num_found)
23073 Py_ssize_t num_expected;
23074 const char *more_or_less;
23075 if (num_found < num_min) {
23076 num_expected = num_min;
23077 more_or_less =
"at least";
23079 num_expected = num_max;
23080 more_or_less =
"at most";
23083 more_or_less =
"exactly";
23085 PyErr_Format(PyExc_TypeError,
23086 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23087 func_name, more_or_less, num_expected,
23088 (num_expected == 1) ?
"" :
"s", num_found);
23092 static int __Pyx_CheckKeywordStrings(
23094 const char* function_name,
23098 Py_ssize_t pos = 0;
23099 #if CYTHON_COMPILING_IN_PYPY
23100 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
23101 goto invalid_keyword;
23104 while (PyDict_Next(kwdict, &pos, &key, 0)) {
23105 #if PY_MAJOR_VERSION < 3
23106 if (unlikely(!PyString_Check(key)))
23108 if (unlikely(!PyUnicode_Check(key)))
23109 goto invalid_keyword_type;
23111 if ((!kw_allowed) && unlikely(key))
23112 goto invalid_keyword;
23114 invalid_keyword_type:
23115 PyErr_Format(PyExc_TypeError,
23116 "%.200s() keywords must be strings", function_name);
23120 PyErr_Format(PyExc_TypeError,
23121 #
if PY_MAJOR_VERSION < 3
23122 "%.200s() got an unexpected keyword argument '%.200s'",
23123 function_name, PyString_AsString(key));
23125 "%s() got an unexpected keyword argument '%U'",
23126 function_name, key);
23132 #if CYTHON_FAST_THREAD_STATE
23133 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23134 PyObject *tmp_type, *tmp_value, *tmp_tb;
23135 tmp_type = tstate->curexc_type;
23136 tmp_value = tstate->curexc_value;
23137 tmp_tb = tstate->curexc_traceback;
23138 tstate->curexc_type = type;
23139 tstate->curexc_value = value;
23140 tstate->curexc_traceback = tb;
23141 Py_XDECREF(tmp_type);
23142 Py_XDECREF(tmp_value);
23143 Py_XDECREF(tmp_tb);
23145 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23146 *type = tstate->curexc_type;
23147 *value = tstate->curexc_value;
23148 *tb = tstate->curexc_traceback;
23149 tstate->curexc_type = 0;
23150 tstate->curexc_value = 0;
23151 tstate->curexc_traceback = 0;
23157 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
23158 PyFrameObject** frame,
23159 PyThreadState* tstate,
23160 const char *funcname,
23161 const char *srcfile,
23163 PyObject *type, *value, *traceback;
23165 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
23166 if (*code == NULL) {
23167 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
23168 if (*code == NULL)
return 0;
23170 *frame = PyFrame_New(
23176 if (*frame == NULL)
return 0;
23177 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
23178 Py_INCREF(Py_None);
23179 (*frame)->f_trace = Py_None;
23181 #if PY_VERSION_HEX < 0x030400B1
23183 (*frame)->f_tstate = tstate;
23186 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
23188 __Pyx_EnterTracing(tstate);
23189 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
23191 if (tstate->c_tracefunc)
23192 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
23193 if (retval && tstate->c_profilefunc)
23195 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
23196 __Pyx_LeaveTracing(tstate);
23198 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
23199 return __Pyx_IsTracing(tstate, 0, 0) && retval;
23203 Py_XDECREF(traceback);
23207 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
23208 PyCodeObject *py_code = 0;
23209 #if PY_MAJOR_VERSION >= 3
23210 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
23211 if (likely(py_code)) {
23212 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
23215 PyObject *py_srcfile = 0;
23216 PyObject *py_funcname = 0;
23217 py_funcname = PyString_FromString(funcname);
23218 if (unlikely(!py_funcname))
goto bad;
23219 py_srcfile = PyString_FromString(srcfile);
23220 if (unlikely(!py_srcfile))
goto bad;
23221 py_code = PyCode_New(
23225 CO_OPTIMIZED | CO_NEWLOCALS,
23238 Py_XDECREF(py_srcfile);
23239 Py_XDECREF(py_funcname);
23246 #if CYTHON_COMPILING_IN_CPYTHON
23247 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23249 ternaryfunc call = Py_TYPE(func)->tp_call;
23250 if (unlikely(!call))
23251 return PyObject_Call(func, arg, kw);
23252 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23254 result = (*call)(func, arg, kw);
23255 Py_LeaveRecursiveCall();
23256 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23259 "NULL result without error in PyObject_Call");
23266 #if PY_MAJOR_VERSION < 3
23267 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23268 CYTHON_UNUSED PyObject *cause) {
23269 __Pyx_PyThreadState_declare
23271 if (!value || value == Py_None)
23275 if (!tb || tb == Py_None)
23279 if (!PyTraceBack_Check(tb)) {
23280 PyErr_SetString(PyExc_TypeError,
23281 "raise: arg 3 must be a traceback or None");
23285 if (PyType_Check(type)) {
23286 #if CYTHON_COMPILING_IN_PYPY
23288 Py_INCREF(Py_None);
23292 PyErr_NormalizeException(&type, &value, &tb);
23295 PyErr_SetString(PyExc_TypeError,
23296 "instance exception may not have a separate value");
23300 type = (PyObject*) Py_TYPE(type);
23302 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23303 PyErr_SetString(PyExc_TypeError,
23304 "raise: exception class must be a subclass of BaseException");
23308 __Pyx_PyThreadState_assign
23309 __Pyx_ErrRestore(type, value, tb);
23318 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23319 PyObject* owned_instance = NULL;
23320 if (tb == Py_None) {
23322 }
else if (tb && !PyTraceBack_Check(tb)) {
23323 PyErr_SetString(PyExc_TypeError,
23324 "raise: arg 3 must be a traceback or None");
23327 if (value == Py_None)
23329 if (PyExceptionInstance_Check(type)) {
23331 PyErr_SetString(PyExc_TypeError,
23332 "instance exception may not have a separate value");
23336 type = (PyObject*) Py_TYPE(value);
23337 }
else if (PyExceptionClass_Check(type)) {
23338 PyObject *instance_class = NULL;
23339 if (value && PyExceptionInstance_Check(value)) {
23340 instance_class = (PyObject*) Py_TYPE(value);
23341 if (instance_class != type) {
23342 int is_subclass = PyObject_IsSubclass(instance_class, type);
23343 if (!is_subclass) {
23344 instance_class = NULL;
23345 }
else if (unlikely(is_subclass == -1)) {
23348 type = instance_class;
23352 if (!instance_class) {
23355 args = PyTuple_New(0);
23356 else if (PyTuple_Check(value)) {
23360 args = PyTuple_Pack(1, value);
23363 owned_instance = PyObject_Call(type, args, NULL);
23365 if (!owned_instance)
23367 value = owned_instance;
23368 if (!PyExceptionInstance_Check(value)) {
23369 PyErr_Format(PyExc_TypeError,
23370 "calling %R should have returned an instance of "
23371 "BaseException, not %R",
23372 type, Py_TYPE(value));
23377 PyErr_SetString(PyExc_TypeError,
23378 "raise: exception class must be a subclass of BaseException");
23382 PyObject *fixed_cause;
23383 if (cause == Py_None) {
23384 fixed_cause = NULL;
23385 }
else if (PyExceptionClass_Check(cause)) {
23386 fixed_cause = PyObject_CallObject(cause, NULL);
23387 if (fixed_cause == NULL)
23389 }
else if (PyExceptionInstance_Check(cause)) {
23390 fixed_cause = cause;
23391 Py_INCREF(fixed_cause);
23393 PyErr_SetString(PyExc_TypeError,
23394 "exception causes must derive from "
23398 PyException_SetCause(value, fixed_cause);
23400 PyErr_SetObject(type, value);
23402 #if CYTHON_FAST_THREAD_STATE
23403 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23404 PyObject* tmp_tb = tstate->curexc_traceback;
23405 if (tb != tmp_tb) {
23407 tstate->curexc_traceback = tb;
23408 Py_XDECREF(tmp_tb);
23411 PyObject *tmp_type, *tmp_value, *tmp_tb;
23412 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23414 PyErr_Restore(tmp_type, tmp_value, tb);
23415 Py_XDECREF(tmp_tb);
23419 Py_XDECREF(owned_instance);
23425 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
23426 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
23427 int full_traceback, CYTHON_UNUSED
int nogil) {
23428 PyObject *old_exc, *old_val, *old_tb;
23430 __Pyx_PyThreadState_declare
23432 PyGILState_STATE state;
23434 state = PyGILState_Ensure();
23435 else state = (PyGILState_STATE)0;
23437 __Pyx_PyThreadState_assign
23438 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
23439 if (full_traceback) {
23440 Py_XINCREF(old_exc);
23441 Py_XINCREF(old_val);
23442 Py_XINCREF(old_tb);
23443 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23446 #if PY_MAJOR_VERSION < 3
23447 ctx = PyString_FromString(name);
23449 ctx = PyUnicode_FromString(name);
23451 __Pyx_ErrRestore(old_exc, old_val, old_tb);
23453 PyErr_WriteUnraisable(Py_None);
23455 PyErr_WriteUnraisable(ctx);
23460 PyGILState_Release(state);
23465 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
23466 #if CYTHON_COMPILING_IN_PYPY
23467 return PyObject_RichCompareBool(s1, s2, equals);
23470 return (equals == Py_EQ);
23471 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
23472 const char *ps1, *ps2;
23473 Py_ssize_t length = PyBytes_GET_SIZE(s1);
23474 if (length != PyBytes_GET_SIZE(s2))
23475 return (equals == Py_NE);
23476 ps1 = PyBytes_AS_STRING(s1);
23477 ps2 = PyBytes_AS_STRING(s2);
23478 if (ps1[0] != ps2[0]) {
23479 return (equals == Py_NE);
23480 }
else if (length == 1) {
23481 return (equals == Py_EQ);
23484 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
23485 Py_hash_t hash1, hash2;
23486 hash1 = ((PyBytesObject*)s1)->ob_shash;
23487 hash2 = ((PyBytesObject*)s2)->ob_shash;
23488 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23489 return (equals == Py_NE);
23492 result = memcmp(ps1, ps2, (
size_t)length);
23493 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23495 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
23496 return (equals == Py_NE);
23497 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
23498 return (equals == Py_NE);
23501 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23504 result = __Pyx_PyObject_IsTrue(py_result);
23505 Py_DECREF(py_result);
23512 #if CYTHON_FAST_PYCCALL
23513 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23514 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23515 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23516 PyObject *
self = PyCFunction_GET_SELF(func);
23517 int flags = PyCFunction_GET_FLAGS(func);
23518 assert(PyCFunction_Check(func));
23519 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23520 assert(nargs >= 0);
23521 assert(nargs == 0 || args != NULL);
23525 assert(!PyErr_Occurred());
23526 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23527 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
23529 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
23535 #if CYTHON_FAST_PYCALL
23536 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23537 PyObject *globals) {
23539 PyThreadState *tstate = __Pyx_PyThreadState_Current;
23540 PyObject **fastlocals;
23543 assert(globals != NULL);
23548 assert(tstate != NULL);
23549 f = PyFrame_New(tstate, co, globals, NULL);
23553 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23554 for (i = 0; i < na; i++) {
23556 fastlocals[i] = *args++;
23558 result = PyEval_EvalFrameEx(f,0);
23559 ++tstate->recursion_depth;
23561 --tstate->recursion_depth;
23564 #if 1 || PY_VERSION_HEX < 0x030600B1
23565 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23566 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23567 PyObject *globals = PyFunction_GET_GLOBALS(func);
23568 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23570 #if PY_MAJOR_VERSION >= 3
23573 PyObject *kwtuple, **k;
23578 assert(kwargs == NULL || PyDict_Check(kwargs));
23579 nk = kwargs ? PyDict_Size(kwargs) : 0;
23580 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
23584 #
if PY_MAJOR_VERSION >= 3
23585 co->co_kwonlyargcount == 0 &&
23587 likely(kwargs == NULL || nk == 0) &&
23588 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23589 if (argdefs == NULL && co->co_argcount == nargs) {
23590 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23593 else if (nargs == 0 && argdefs != NULL
23594 && co->co_argcount == Py_SIZE(argdefs)) {
23597 args = &PyTuple_GET_ITEM(argdefs, 0);
23598 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23602 if (kwargs != NULL) {
23604 kwtuple = PyTuple_New(2 * nk);
23605 if (kwtuple == NULL) {
23609 k = &PyTuple_GET_ITEM(kwtuple, 0);
23611 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23622 closure = PyFunction_GET_CLOSURE(func);
23623 #if PY_MAJOR_VERSION >= 3
23624 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23626 if (argdefs != NULL) {
23627 d = &PyTuple_GET_ITEM(argdefs, 0);
23628 nd = Py_SIZE(argdefs);
23634 #if PY_MAJOR_VERSION >= 3
23635 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23638 d, (
int)nd, kwdefs, closure);
23640 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23643 d, (
int)nd, closure);
23645 Py_XDECREF(kwtuple);
23647 Py_LeaveRecursiveCall();
23654 #if CYTHON_COMPILING_IN_CPYTHON
23655 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23656 PyObject *
self, *result;
23658 cfunc = PyCFunction_GET_FUNCTION(func);
23659 self = PyCFunction_GET_SELF(func);
23660 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23662 result = cfunc(
self, arg);
23663 Py_LeaveRecursiveCall();
23664 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23667 "NULL result without error in PyObject_Call");
23674 #if CYTHON_COMPILING_IN_CPYTHON
23675 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23677 PyObject *args = PyTuple_New(1);
23678 if (unlikely(!args))
return NULL;
23680 PyTuple_SET_ITEM(args, 0, arg);
23681 result = __Pyx_PyObject_Call(func, args, NULL);
23685 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23686 #if CYTHON_FAST_PYCALL
23687 if (PyFunction_Check(func)) {
23688 return __Pyx_PyFunction_FastCall(func, &arg, 1);
23691 if (likely(PyCFunction_Check(func))) {
23692 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23693 return __Pyx_PyObject_CallMethO(func, arg);
23694 #if CYTHON_FAST_PYCCALL
23695 }
else if (__Pyx_PyFastCFunction_Check(func)) {
23696 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23700 return __Pyx__PyObject_CallOneArg(func, arg);
23703 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23705 PyObject *args = PyTuple_Pack(1, arg);
23706 if (unlikely(!args))
return NULL;
23707 result = __Pyx_PyObject_Call(func, args, NULL);
23714 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
23715 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
23716 PyObject *dict = Py_TYPE(obj)->tp_dict;
23717 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
23719 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
23720 PyObject **dictptr = NULL;
23721 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
23723 #if CYTHON_COMPILING_IN_CPYTHON
23724 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
23726 dictptr = _PyObject_GetDictPtr(obj);
23729 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
23731 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
23732 PyObject *dict = Py_TYPE(obj)->tp_dict;
23733 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
23735 return obj_dict_version == __Pyx_get_object_dict_version(obj);
23740 #if CYTHON_USE_DICT_VERSIONS
23741 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
23743 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
23747 #if !CYTHON_AVOID_BORROWED_REFS
23748 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
23749 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
23750 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23751 if (likely(result)) {
23752 return __Pyx_NewRef(result);
23753 }
else if (unlikely(PyErr_Occurred())) {
23757 result = PyDict_GetItem(__pyx_d, name);
23758 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23759 if (likely(result)) {
23760 return __Pyx_NewRef(result);
23764 result = PyObject_GetItem(__pyx_d, name);
23765 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
23766 if (likely(result)) {
23767 return __Pyx_NewRef(result);
23771 return __Pyx_GetBuiltinName(name);
23775 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
23776 PyObject *args, *result = NULL;
23777 #if CYTHON_FAST_PYCALL
23778 if (PyFunction_Check(
function)) {
23779 PyObject *args[2] = {arg1, arg2};
23780 return __Pyx_PyFunction_FastCall(
function, args, 2);
23783 #if CYTHON_FAST_PYCCALL
23784 if (__Pyx_PyFastCFunction_Check(
function)) {
23785 PyObject *args[2] = {arg1, arg2};
23786 return __Pyx_PyCFunction_FastCall(
function, args, 2);
23789 args = PyTuple_New(2);
23790 if (unlikely(!args))
goto done;
23792 PyTuple_SET_ITEM(args, 0, arg1);
23794 PyTuple_SET_ITEM(args, 1, arg2);
23795 Py_INCREF(
function);
23796 result = __Pyx_PyObject_Call(
function, args, NULL);
23798 Py_DECREF(
function);
23804 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
23805 #if CYTHON_COMPILING_IN_PYPY
23806 return PyObject_RichCompareBool(s1, s2, equals);
23808 #if PY_MAJOR_VERSION < 3
23809 PyObject* owned_ref = NULL;
23811 int s1_is_unicode, s2_is_unicode;
23815 s1_is_unicode = PyUnicode_CheckExact(s1);
23816 s2_is_unicode = PyUnicode_CheckExact(s2);
23817 #if PY_MAJOR_VERSION < 3
23818 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
23819 owned_ref = PyUnicode_FromObject(s2);
23820 if (unlikely(!owned_ref))
23824 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23825 owned_ref = PyUnicode_FromObject(s1);
23826 if (unlikely(!owned_ref))
23830 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23831 return __Pyx_PyBytes_Equals(s1, s2, equals);
23834 if (s1_is_unicode & s2_is_unicode) {
23837 void *data1, *data2;
23838 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23840 length = __Pyx_PyUnicode_GET_LENGTH(s1);
23841 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23844 #if CYTHON_USE_UNICODE_INTERNALS
23846 Py_hash_t hash1, hash2;
23847 #if CYTHON_PEP393_ENABLED
23848 hash1 = ((PyASCIIObject*)s1)->hash;
23849 hash2 = ((PyASCIIObject*)s2)->hash;
23851 hash1 = ((PyUnicodeObject*)s1)->hash;
23852 hash2 = ((PyUnicodeObject*)s2)->hash;
23854 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23859 kind = __Pyx_PyUnicode_KIND(s1);
23860 if (kind != __Pyx_PyUnicode_KIND(s2)) {
23863 data1 = __Pyx_PyUnicode_DATA(s1);
23864 data2 = __Pyx_PyUnicode_DATA(s2);
23865 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
23867 }
else if (length == 1) {
23870 int result = memcmp(data1, data2, (
size_t)(length * kind));
23871 #if PY_MAJOR_VERSION < 3
23872 Py_XDECREF(owned_ref);
23874 return (equals == Py_EQ) ? (result == 0) : (result != 0);
23876 }
else if ((s1 == Py_None) & s2_is_unicode) {
23878 }
else if ((s2 == Py_None) & s1_is_unicode) {
23882 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23883 #if PY_MAJOR_VERSION < 3
23884 Py_XDECREF(owned_ref);
23888 result = __Pyx_PyObject_IsTrue(py_result);
23889 Py_DECREF(py_result);
23893 #if PY_MAJOR_VERSION < 3
23894 Py_XDECREF(owned_ref);
23896 return (equals == Py_EQ);
23898 #if PY_MAJOR_VERSION < 3
23899 Py_XDECREF(owned_ref);
23901 return (equals == Py_NE);
23907 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
23909 __Pyx_memviewslice *memviewslice,
23910 int memview_is_new_reference)
23912 __Pyx_RefNannyDeclarations
23914 Py_buffer *buf = &memview->view;
23915 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
23916 if (unlikely(memviewslice->memview || memviewslice->data)) {
23917 PyErr_SetString(PyExc_ValueError,
23918 "memviewslice is already initialized!");
23921 if (buf->strides) {
23922 for (i = 0; i < ndim; i++) {
23923 memviewslice->strides[i] = buf->strides[i];
23926 Py_ssize_t stride = buf->itemsize;
23927 for (i = ndim - 1; i >= 0; i--) {
23928 memviewslice->strides[i] = stride;
23929 stride *= buf->shape[i];
23932 for (i = 0; i < ndim; i++) {
23933 memviewslice->shape[i] = buf->shape[i];
23934 if (buf->suboffsets) {
23935 memviewslice->suboffsets[i] = buf->suboffsets[i];
23937 memviewslice->suboffsets[i] = -1;
23940 memviewslice->memview = memview;
23941 memviewslice->data = (
char *)buf->buf;
23942 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23943 Py_INCREF(memview);
23948 memviewslice->memview = 0;
23949 memviewslice->data = 0;
23952 __Pyx_RefNannyFinishContext();
23955 #ifndef Py_NO_RETURN
23956 #define Py_NO_RETURN
23958 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
23961 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
23962 va_start(vargs, fmt);
23966 vsnprintf(msg, 200, fmt, vargs);
23968 Py_FatalError(msg);
23970 static CYTHON_INLINE
int
23971 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23972 PyThread_type_lock lock)
23975 PyThread_acquire_lock(lock, 1);
23976 result = (*acquisition_count)++;
23977 PyThread_release_lock(lock);
23980 static CYTHON_INLINE
int
23981 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23982 PyThread_type_lock lock)
23985 PyThread_acquire_lock(lock, 1);
23986 result = (*acquisition_count)--;
23987 PyThread_release_lock(lock);
23990 static CYTHON_INLINE
void
23991 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
23994 struct __pyx_memoryview_obj *memview = memslice->memview;
23995 if (unlikely(!memview || (PyObject *) memview == Py_None))
23997 if (unlikely(__pyx_get_slice_count(memview) < 0))
23998 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
23999 __pyx_get_slice_count(memview), lineno);
24000 first_time = __pyx_add_acquisition_count(memview) == 0;
24001 if (unlikely(first_time)) {
24003 Py_INCREF((PyObject *) memview);
24005 PyGILState_STATE _gilstate = PyGILState_Ensure();
24006 Py_INCREF((PyObject *) memview);
24007 PyGILState_Release(_gilstate);
24011 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24012 int have_gil,
int lineno) {
24014 struct __pyx_memoryview_obj *memview = memslice->memview;
24015 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24016 memslice->memview = NULL;
24019 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24020 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24021 __pyx_get_slice_count(memview), lineno);
24022 last_time = __pyx_sub_acquisition_count(memview) == 1;
24023 memslice->data = NULL;
24024 if (unlikely(last_time)) {
24026 Py_CLEAR(memslice->memview);
24028 PyGILState_STATE _gilstate = PyGILState_Ensure();
24029 Py_CLEAR(memslice->memview);
24030 PyGILState_Release(_gilstate);
24033 memslice->memview = NULL;
24038 static void __Pyx_RaiseDoubleKeywordsError(
24039 const char* func_name,
24042 PyErr_Format(PyExc_TypeError,
24043 #
if PY_MAJOR_VERSION >= 3
24044 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24046 "%s() got multiple values for keyword argument '%s'", func_name,
24047 PyString_AsString(kw_name));
24052 static int __Pyx_ParseOptionalKeywords(
24054 PyObject **argnames[],
24056 PyObject *values[],
24057 Py_ssize_t num_pos_args,
24058 const char* function_name)
24060 PyObject *key = 0, *value = 0;
24061 Py_ssize_t pos = 0;
24063 PyObject*** first_kw_arg = argnames + num_pos_args;
24064 while (PyDict_Next(kwds, &pos, &key, &value)) {
24065 name = first_kw_arg;
24066 while (*name && (**name != key)) name++;
24068 values[name-argnames] = value;
24071 name = first_kw_arg;
24072 #if PY_MAJOR_VERSION < 3
24073 if (likely(PyString_Check(key))) {
24075 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24076 && _PyString_Eq(**name, key)) {
24077 values[name-argnames] = value;
24082 if (*name)
continue;
24084 PyObject*** argname = argnames;
24085 while (argname != first_kw_arg) {
24086 if ((**argname == key) || (
24087 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24088 && _PyString_Eq(**argname, key))) {
24089 goto arg_passed_twice;
24096 if (likely(PyUnicode_Check(key))) {
24098 int cmp = (**name == key) ? 0 :
24099 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24100 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24102 PyUnicode_Compare(**name, key);
24103 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24105 values[name-argnames] = value;
24110 if (*name)
continue;
24112 PyObject*** argname = argnames;
24113 while (argname != first_kw_arg) {
24114 int cmp = (**argname == key) ? 0 :
24115 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24116 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24118 PyUnicode_Compare(**argname, key);
24119 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24120 if (cmp == 0)
goto arg_passed_twice;
24125 goto invalid_keyword_type;
24127 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24129 goto invalid_keyword;
24134 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24136 invalid_keyword_type:
24137 PyErr_Format(PyExc_TypeError,
24138 "%.200s() keywords must be strings", function_name);
24141 PyErr_Format(PyExc_TypeError,
24142 #
if PY_MAJOR_VERSION < 3
24143 "%.200s() got an unexpected keyword argument '%.200s'",
24144 function_name, PyString_AsString(key));
24146 "%s() got an unexpected keyword argument '%U'",
24147 function_name, key);
24154 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24156 if (unlikely(!type)) {
24157 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24161 #if PY_MAJOR_VERSION == 2
24162 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24166 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24168 PyErr_Format(PyExc_TypeError,
24169 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24170 name, type->tp_name, Py_TYPE(obj)->tp_name);
24175 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24176 #if CYTHON_USE_TYPE_SLOTS
24177 #if PY_MAJOR_VERSION >= 3
24178 if (likely(PyUnicode_Check(n)))
24180 if (likely(PyString_Check(n)))
24182 return __Pyx_PyObject_GetAttrStr(o, n);
24184 return PyObject_GetAttr(o, n);
24188 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24190 if (!j)
return NULL;
24191 r = PyObject_GetItem(o, j);
24195 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24196 CYTHON_NCP_UNUSED
int wraparound,
24197 CYTHON_NCP_UNUSED
int boundscheck) {
24198 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24199 Py_ssize_t wrapped_i = i;
24200 if (wraparound & unlikely(i < 0)) {
24201 wrapped_i += PyList_GET_SIZE(o);
24203 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24204 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24208 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24210 return PySequence_GetItem(o, i);
24213 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24214 CYTHON_NCP_UNUSED
int wraparound,
24215 CYTHON_NCP_UNUSED
int boundscheck) {
24216 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24217 Py_ssize_t wrapped_i = i;
24218 if (wraparound & unlikely(i < 0)) {
24219 wrapped_i += PyTuple_GET_SIZE(o);
24221 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24222 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24226 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24228 return PySequence_GetItem(o, i);
24231 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24232 CYTHON_NCP_UNUSED
int wraparound,
24233 CYTHON_NCP_UNUSED
int boundscheck) {
24234 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24235 if (is_list || PyList_CheckExact(o)) {
24236 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24237 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24238 PyObject *r = PyList_GET_ITEM(o, n);
24243 else if (PyTuple_CheckExact(o)) {
24244 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24245 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24246 PyObject *r = PyTuple_GET_ITEM(o, n);
24251 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24252 if (likely(m && m->sq_item)) {
24253 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24254 Py_ssize_t l = m->sq_length(o);
24255 if (likely(l >= 0)) {
24258 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24263 return m->sq_item(o, i);
24267 if (is_list || PySequence_Check(o)) {
24268 return PySequence_GetItem(o, i);
24271 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24275 #if CYTHON_USE_TYPE_SLOTS
24276 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24277 PyObject *runerr = NULL;
24278 Py_ssize_t key_value;
24279 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24280 if (unlikely(!(m && m->sq_item))) {
24281 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24284 key_value = __Pyx_PyIndex_AsSsize_t(index);
24285 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24286 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24288 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24290 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24294 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24295 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24296 if (likely(m && m->mp_subscript)) {
24297 return m->mp_subscript(obj, key);
24299 return __Pyx_PyObject_GetIndex(obj, key);
24304 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24305 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24306 const char* encoding,
const char* errors,
24307 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
24309 if (unlikely((start < 0) | (stop < 0))) {
24310 size_t slen = strlen(cstring);
24311 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
24312 PyErr_SetString(PyExc_OverflowError,
24313 "c-string too long to convert to Python");
24316 length = (Py_ssize_t) slen;
24325 if (unlikely(stop <= start))
24326 return __Pyx_NewRef(__pyx_empty_unicode);
24327 length = stop - start;
24330 return decode_func(cstring, length, errors);
24332 return PyUnicode_Decode(cstring, length, encoding, errors);
24337 #if CYTHON_FAST_THREAD_STATE
24338 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24340 n = PyTuple_GET_SIZE(tuple);
24341 #if PY_MAJOR_VERSION >= 3
24342 for (i=0; i<n; i++) {
24343 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24346 for (i=0; i<n; i++) {
24347 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24351 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24352 PyObject *exc_type = tstate->curexc_type;
24353 if (exc_type == err)
return 1;
24354 if (unlikely(!exc_type))
return 0;
24355 if (unlikely(PyTuple_Check(err)))
24356 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24357 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24362 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24363 __Pyx_PyThreadState_declare
24364 __Pyx_PyThreadState_assign
24365 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24367 __Pyx_PyErr_Clear();
24371 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24372 PyObject *r = __Pyx_GetAttr(o, n);
24373 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24377 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24378 PyErr_Format(PyExc_ValueError,
24379 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24383 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24384 PyErr_Format(PyExc_ValueError,
24385 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24386 index, (index == 1) ?
"" :
"s");
24390 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24391 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24395 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24396 if (unlikely(!type)) {
24397 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24400 if (likely(__Pyx_TypeCheck(obj, type)))
24402 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24403 Py_TYPE(obj)->tp_name, type->tp_name);
24408 #if CYTHON_USE_EXC_INFO_STACK
24409 static _PyErr_StackItem *
24410 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24412 _PyErr_StackItem *exc_info = tstate->exc_info;
24413 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24414 exc_info->previous_item != NULL)
24416 exc_info = exc_info->previous_item;
24423 #if CYTHON_FAST_THREAD_STATE
24424 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24425 #if CYTHON_USE_EXC_INFO_STACK
24426 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24427 *type = exc_info->exc_type;
24428 *value = exc_info->exc_value;
24429 *tb = exc_info->exc_traceback;
24431 *type = tstate->exc_type;
24432 *value = tstate->exc_value;
24433 *tb = tstate->exc_traceback;
24436 Py_XINCREF(*value);
24439 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24440 PyObject *tmp_type, *tmp_value, *tmp_tb;
24441 #if CYTHON_USE_EXC_INFO_STACK
24442 _PyErr_StackItem *exc_info = tstate->exc_info;
24443 tmp_type = exc_info->exc_type;
24444 tmp_value = exc_info->exc_value;
24445 tmp_tb = exc_info->exc_traceback;
24446 exc_info->exc_type = type;
24447 exc_info->exc_value = value;
24448 exc_info->exc_traceback = tb;
24450 tmp_type = tstate->exc_type;
24451 tmp_value = tstate->exc_value;
24452 tmp_tb = tstate->exc_traceback;
24453 tstate->exc_type = type;
24454 tstate->exc_value = value;
24455 tstate->exc_traceback = tb;
24457 Py_XDECREF(tmp_type);
24458 Py_XDECREF(tmp_value);
24459 Py_XDECREF(tmp_tb);
24464 #if CYTHON_FAST_THREAD_STATE
24465 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24467 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24470 PyObject *local_type, *local_value, *local_tb;
24471 #if CYTHON_FAST_THREAD_STATE
24472 PyObject *tmp_type, *tmp_value, *tmp_tb;
24473 local_type = tstate->curexc_type;
24474 local_value = tstate->curexc_value;
24475 local_tb = tstate->curexc_traceback;
24476 tstate->curexc_type = 0;
24477 tstate->curexc_value = 0;
24478 tstate->curexc_traceback = 0;
24480 PyErr_Fetch(&local_type, &local_value, &local_tb);
24482 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24483 #if CYTHON_FAST_THREAD_STATE
24484 if (unlikely(tstate->curexc_type))
24486 if (unlikely(PyErr_Occurred()))
24489 #if PY_MAJOR_VERSION >= 3
24491 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24495 Py_XINCREF(local_tb);
24496 Py_XINCREF(local_type);
24497 Py_XINCREF(local_value);
24498 *type = local_type;
24499 *value = local_value;
24501 #if CYTHON_FAST_THREAD_STATE
24502 #if CYTHON_USE_EXC_INFO_STACK
24504 _PyErr_StackItem *exc_info = tstate->exc_info;
24505 tmp_type = exc_info->exc_type;
24506 tmp_value = exc_info->exc_value;
24507 tmp_tb = exc_info->exc_traceback;
24508 exc_info->exc_type = local_type;
24509 exc_info->exc_value = local_value;
24510 exc_info->exc_traceback = local_tb;
24513 tmp_type = tstate->exc_type;
24514 tmp_value = tstate->exc_value;
24515 tmp_tb = tstate->exc_traceback;
24516 tstate->exc_type = local_type;
24517 tstate->exc_value = local_value;
24518 tstate->exc_traceback = local_tb;
24520 Py_XDECREF(tmp_type);
24521 Py_XDECREF(tmp_value);
24522 Py_XDECREF(tmp_tb);
24524 PyErr_SetExcInfo(local_type, local_value, local_tb);
24531 Py_XDECREF(local_type);
24532 Py_XDECREF(local_value);
24533 Py_XDECREF(local_tb);
24538 #if CYTHON_FAST_THREAD_STATE
24539 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24540 PyObject *tmp_type, *tmp_value, *tmp_tb;
24541 #if CYTHON_USE_EXC_INFO_STACK
24542 _PyErr_StackItem *exc_info = tstate->exc_info;
24543 tmp_type = exc_info->exc_type;
24544 tmp_value = exc_info->exc_value;
24545 tmp_tb = exc_info->exc_traceback;
24546 exc_info->exc_type = *type;
24547 exc_info->exc_value = *value;
24548 exc_info->exc_traceback = *tb;
24550 tmp_type = tstate->exc_type;
24551 tmp_value = tstate->exc_value;
24552 tmp_tb = tstate->exc_traceback;
24553 tstate->exc_type = *type;
24554 tstate->exc_value = *value;
24555 tstate->exc_traceback = *tb;
24558 *value = tmp_value;
24562 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
24563 PyObject *tmp_type, *tmp_value, *tmp_tb;
24564 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
24565 PyErr_SetExcInfo(*type, *value, *tb);
24567 *value = tmp_value;
24573 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24574 PyObject *empty_list = 0;
24575 PyObject *module = 0;
24576 PyObject *global_dict = 0;
24577 PyObject *empty_dict = 0;
24579 #if PY_MAJOR_VERSION < 3
24580 PyObject *py_import;
24581 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24588 empty_list = PyList_New(0);
24593 global_dict = PyModule_GetDict(__pyx_m);
24596 empty_dict = PyDict_New();
24600 #if PY_MAJOR_VERSION >= 3
24602 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
24603 module = PyImport_ImportModuleLevelObject(
24604 name, global_dict, empty_dict, list, 1);
24606 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24615 #if PY_MAJOR_VERSION < 3
24616 PyObject *py_level = PyInt_FromLong(level);
24619 module = PyObject_CallFunctionObjArgs(py_import,
24620 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24621 Py_DECREF(py_level);
24623 module = PyImport_ImportModuleLevelObject(
24624 name, global_dict, empty_dict, list, level);
24629 #if PY_MAJOR_VERSION < 3
24630 Py_XDECREF(py_import);
24632 Py_XDECREF(empty_list);
24633 Py_XDECREF(empty_dict);
24638 #if CYTHON_COMPILING_IN_CPYTHON
24639 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24645 return b == &PyBaseObject_Type;
24647 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24649 if (a == b)
return 1;
24653 n = PyTuple_GET_SIZE(mro);
24654 for (i = 0; i < n; i++) {
24655 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24660 return __Pyx_InBases(a, b);
24662 #if PY_MAJOR_VERSION == 2
24663 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
24664 PyObject *exception, *value, *tb;
24666 __Pyx_PyThreadState_declare
24667 __Pyx_PyThreadState_assign
24668 __Pyx_ErrFetch(&exception, &value, &tb);
24669 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
24670 if (unlikely(res == -1)) {
24671 PyErr_WriteUnraisable(err);
24675 res = PyObject_IsSubclass(err, exc_type2);
24676 if (unlikely(res == -1)) {
24677 PyErr_WriteUnraisable(err);
24681 __Pyx_ErrRestore(exception, value, tb);
24685 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
24686 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
24688 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24693 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24695 assert(PyExceptionClass_Check(exc_type));
24696 n = PyTuple_GET_SIZE(tuple);
24697 #if PY_MAJOR_VERSION >= 3
24698 for (i=0; i<n; i++) {
24699 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24702 for (i=0; i<n; i++) {
24703 PyObject *t = PyTuple_GET_ITEM(tuple, i);
24704 #if PY_MAJOR_VERSION < 3
24705 if (likely(exc_type == t))
return 1;
24707 if (likely(PyExceptionClass_Check(t))) {
24708 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
24714 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
24715 if (likely(err == exc_type))
return 1;
24716 if (likely(PyExceptionClass_Check(err))) {
24717 if (likely(PyExceptionClass_Check(exc_type))) {
24718 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
24719 }
else if (likely(PyTuple_Check(exc_type))) {
24720 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
24724 return PyErr_GivenExceptionMatches(err, exc_type);
24726 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
24727 assert(PyExceptionClass_Check(exc_type1));
24728 assert(PyExceptionClass_Check(exc_type2));
24729 if (likely(err == exc_type1 || err == exc_type2))
return 1;
24730 if (likely(PyExceptionClass_Check(err))) {
24731 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
24733 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24738 #if !CYTHON_COMPILING_IN_PYPY
24739 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
24741 (void)zerodivision_check;
24742 #if PY_MAJOR_VERSION < 3
24743 if (likely(PyInt_CheckExact(op1))) {
24744 const long b = intval;
24746 long a = PyInt_AS_LONG(op1);
24747 x = (long)((
unsigned long)a + b);
24748 if (likely((x^a) >= 0 || (x^b) >= 0))
24749 return PyInt_FromLong(x);
24750 return PyLong_Type.tp_as_number->nb_add(op1, op2);
24753 #if CYTHON_USE_PYLONG_INTERNALS
24754 if (likely(PyLong_CheckExact(op1))) {
24755 const long b = intval;
24757 #ifdef HAVE_LONG_LONG
24758 const PY_LONG_LONG llb = intval;
24759 PY_LONG_LONG lla, llx;
24761 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24762 const Py_ssize_t size = Py_SIZE(op1);
24763 if (likely(__Pyx_sst_abs(size) <= 1)) {
24764 a = likely(size) ? digits[0] : 0;
24765 if (size == -1) a = -a;
24769 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24770 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24772 #ifdef HAVE_LONG_LONG
24773 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24774 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24778 CYTHON_FALLTHROUGH;
24780 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
24781 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24783 #ifdef HAVE_LONG_LONG
24784 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24785 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24789 CYTHON_FALLTHROUGH;
24791 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24792 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24794 #ifdef HAVE_LONG_LONG
24795 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24796 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24800 CYTHON_FALLTHROUGH;
24802 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
24803 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24805 #ifdef HAVE_LONG_LONG
24806 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24807 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24811 CYTHON_FALLTHROUGH;
24813 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24814 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24816 #ifdef HAVE_LONG_LONG
24817 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24818 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24822 CYTHON_FALLTHROUGH;
24824 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
24825 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24827 #ifdef HAVE_LONG_LONG
24828 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24829 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
24833 CYTHON_FALLTHROUGH;
24834 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
24838 return PyLong_FromLong(x);
24839 #ifdef HAVE_LONG_LONG
24842 return PyLong_FromLongLong(llx);
24848 if (PyFloat_CheckExact(op1)) {
24849 const long b = intval;
24850 double a = PyFloat_AS_DOUBLE(op1);
24852 PyFPE_START_PROTECT(
"add",
return NULL)
24853 result = ((double)a) + (double)b;
24854 PyFPE_END_PROTECT(result)
24855 return PyFloat_FromDouble(result);
24857 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24862 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
24863 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
24867 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24868 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24869 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24870 PyErr_Format(PyExc_ImportError,
24871 #
if PY_MAJOR_VERSION < 3
24872 "cannot import name %.230s", PyString_AS_STRING(name));
24874 "cannot import name %S", name);
24881 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24883 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24884 PyErr_SetString(PyExc_TypeError,
24885 "hasattr(): attribute name must be string");
24888 r = __Pyx_GetAttr(o, n);
24889 if (unlikely(!r)) {
24899 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24900 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
24901 PyErr_Format(PyExc_AttributeError,
24902 #
if PY_MAJOR_VERSION >= 3
24903 "'%.50s' object has no attribute '%U'",
24904 tp->tp_name, attr_name);
24906 "'%.50s' object has no attribute '%.400s'",
24907 tp->tp_name, PyString_AS_STRING(attr_name));
24911 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24913 PyTypeObject *tp = Py_TYPE(obj);
24914 if (unlikely(!PyString_Check(attr_name))) {
24915 return PyObject_GenericGetAttr(obj, attr_name);
24917 assert(!tp->tp_dictoffset);
24918 descr = _PyType_Lookup(tp, attr_name);
24919 if (unlikely(!descr)) {
24920 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24923 #if PY_MAJOR_VERSION < 3
24924 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24927 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24929 PyObject *res = f(descr, obj, (PyObject *)tp);
24939 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
24940 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
24941 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
24942 return PyObject_GenericGetAttr(obj, attr_name);
24944 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24949 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
24950 #if PY_VERSION_HEX >= 0x02070000
24951 PyObject *ob = PyCapsule_New(vtable, 0, 0);
24953 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24957 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24967 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
24968 __Pyx_PyThreadState_declare
24969 __Pyx_PyThreadState_assign
24970 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24971 __Pyx_PyErr_Clear();
24973 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24975 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
24976 PyTypeObject* tp = Py_TYPE(obj);
24977 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
24978 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
24981 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24982 if (unlikely(!result)) {
24983 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24989 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24991 PyObject *name_attr;
24992 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
24993 if (likely(name_attr)) {
24994 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
24998 if (unlikely(ret < 0)) {
25002 Py_XDECREF(name_attr);
25005 static int __Pyx_setup_reduce(PyObject* type_obj) {
25007 PyObject *object_reduce = NULL;
25008 PyObject *object_getstate = NULL;
25009 PyObject *object_reduce_ex = NULL;
25010 PyObject *reduce = NULL;
25011 PyObject *reduce_ex = NULL;
25012 PyObject *reduce_cython = NULL;
25013 PyObject *setstate = NULL;
25014 PyObject *setstate_cython = NULL;
25015 PyObject *getstate = NULL;
25016 #if CYTHON_USE_PYTYPE_LOOKUP
25017 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25019 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25020 if (!getstate && PyErr_Occurred()) {
25025 #if CYTHON_USE_PYTYPE_LOOKUP
25026 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25028 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25029 if (!object_getstate && PyErr_Occurred()) {
25033 if (object_getstate != getstate) {
25037 #if CYTHON_USE_PYTYPE_LOOKUP
25038 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25040 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25042 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25043 if (reduce_ex == object_reduce_ex) {
25044 #if CYTHON_USE_PYTYPE_LOOKUP
25045 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25047 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25049 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25050 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25051 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25052 if (likely(reduce_cython)) {
25053 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25054 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25055 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25058 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25059 if (!setstate) PyErr_Clear();
25060 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25061 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25062 if (likely(setstate_cython)) {
25063 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25064 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25065 }
else if (!setstate || PyErr_Occurred()) {
25069 PyType_Modified((PyTypeObject*)type_obj);
25074 if (!PyErr_Occurred())
25075 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25078 #if !CYTHON_USE_PYTYPE_LOOKUP
25079 Py_XDECREF(object_reduce);
25080 Py_XDECREF(object_reduce_ex);
25081 Py_XDECREF(object_getstate);
25082 Py_XDECREF(getstate);
25084 Py_XDECREF(reduce);
25085 Py_XDECREF(reduce_ex);
25086 Py_XDECREF(reduce_cython);
25087 Py_XDECREF(setstate);
25088 Py_XDECREF(setstate_cython);
25093 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25094 PyObject* fake_module;
25095 PyTypeObject* cached_type = NULL;
25096 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25097 if (!fake_module)
return NULL;
25098 Py_INCREF(fake_module);
25099 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25101 if (!PyType_Check((PyObject*)cached_type)) {
25102 PyErr_Format(PyExc_TypeError,
25103 "Shared Cython type %.200s is not a type object",
25107 if (cached_type->tp_basicsize != type->tp_basicsize) {
25108 PyErr_Format(PyExc_TypeError,
25109 "Shared Cython type %.200s has the wrong size, try recompiling",
25114 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25116 if (PyType_Ready(type) < 0)
goto bad;
25117 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25120 cached_type = type;
25123 Py_DECREF(fake_module);
25124 return cached_type;
25126 Py_XDECREF(cached_type);
25127 cached_type = NULL;
25132 #include <structmember.h>
25134 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25136 if (unlikely(op->func_doc == NULL)) {
25137 if (op->func.m_ml->ml_doc) {
25138 #if PY_MAJOR_VERSION >= 3
25139 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25141 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25143 if (unlikely(op->func_doc == NULL))
25146 Py_INCREF(Py_None);
25150 Py_INCREF(op->func_doc);
25151 return op->func_doc;
25154 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25156 PyObject *tmp = op->func_doc;
25157 if (value == NULL) {
25161 op->func_doc = value;
25166 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25168 if (unlikely(op->func_name == NULL)) {
25169 #if PY_MAJOR_VERSION >= 3
25170 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25172 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25174 if (unlikely(op->func_name == NULL))
25177 Py_INCREF(op->func_name);
25178 return op->func_name;
25181 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25184 #if PY_MAJOR_VERSION >= 3
25185 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25187 if (unlikely(value == NULL || !PyString_Check(value)))
25190 PyErr_SetString(PyExc_TypeError,
25191 "__name__ must be set to a string object");
25194 tmp = op->func_name;
25196 op->func_name = value;
25201 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25203 Py_INCREF(op->func_qualname);
25204 return op->func_qualname;
25207 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25210 #if PY_MAJOR_VERSION >= 3
25211 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25213 if (unlikely(value == NULL || !PyString_Check(value)))
25216 PyErr_SetString(PyExc_TypeError,
25217 "__qualname__ must be set to a string object");
25220 tmp = op->func_qualname;
25222 op->func_qualname = value;
25227 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25230 self = m->func_closure;
25237 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25239 if (unlikely(op->func_dict == NULL)) {
25240 op->func_dict = PyDict_New();
25241 if (unlikely(op->func_dict == NULL))
25244 Py_INCREF(op->func_dict);
25245 return op->func_dict;
25248 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25251 if (unlikely(value == NULL)) {
25252 PyErr_SetString(PyExc_TypeError,
25253 "function's dictionary may not be deleted");
25256 if (unlikely(!PyDict_Check(value))) {
25257 PyErr_SetString(PyExc_TypeError,
25258 "setting function's dictionary to a non-dict");
25261 tmp = op->func_dict;
25263 op->func_dict = value;
25268 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25270 Py_INCREF(op->func_globals);
25271 return op->func_globals;
25274 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25276 Py_INCREF(Py_None);
25280 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25282 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25287 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25289 PyObject *res = op->defaults_getter((PyObject *) op);
25290 if (unlikely(!res))
25292 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25293 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25294 Py_INCREF(op->defaults_tuple);
25295 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25296 Py_INCREF(op->defaults_kwdict);
25298 op->defaults_tuple = PySequence_ITEM(res, 0);
25299 if (unlikely(!op->defaults_tuple)) result = -1;
25301 op->defaults_kwdict = PySequence_ITEM(res, 1);
25302 if (unlikely(!op->defaults_kwdict)) result = -1;
25309 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25313 }
else if (value != Py_None && !PyTuple_Check(value)) {
25314 PyErr_SetString(PyExc_TypeError,
25315 "__defaults__ must be set to a tuple object");
25319 tmp = op->defaults_tuple;
25320 op->defaults_tuple = value;
25325 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25326 PyObject* result = op->defaults_tuple;
25327 if (unlikely(!result)) {
25328 if (op->defaults_getter) {
25329 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25330 result = op->defaults_tuple;
25339 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25343 }
else if (value != Py_None && !PyDict_Check(value)) {
25344 PyErr_SetString(PyExc_TypeError,
25345 "__kwdefaults__ must be set to a dict object");
25349 tmp = op->defaults_kwdict;
25350 op->defaults_kwdict = value;
25355 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25356 PyObject* result = op->defaults_kwdict;
25357 if (unlikely(!result)) {
25358 if (op->defaults_getter) {
25359 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25360 result = op->defaults_kwdict;
25369 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
25371 if (!value || value == Py_None) {
25373 }
else if (!PyDict_Check(value)) {
25374 PyErr_SetString(PyExc_TypeError,
25375 "__annotations__ must be set to a dict object");
25379 tmp = op->func_annotations;
25380 op->func_annotations = value;
25385 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
25386 PyObject* result = op->func_annotations;
25387 if (unlikely(!result)) {
25388 result = PyDict_New();
25389 if (unlikely(!result))
return NULL;
25390 op->func_annotations = result;
25395 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25396 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25397 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25398 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25399 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25400 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25401 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25402 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25403 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25404 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25405 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25406 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25407 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25408 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25409 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25410 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25411 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25412 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25413 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25416 static PyMemberDef __pyx_CyFunction_members[] = {
25417 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25421 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25423 #if PY_MAJOR_VERSION >= 3
25424 Py_INCREF(m->func_qualname);
25425 return m->func_qualname;
25427 return PyString_FromString(m->func.m_ml->ml_name);
25430 static PyMethodDef __pyx_CyFunction_methods[] = {
25431 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25434 #if PY_VERSION_HEX < 0x030500A0
25435 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25437 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25439 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
25440 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25441 if (unlikely(op == NULL))
25444 __Pyx_CyFunction_weakreflist(op) = NULL;
25445 op->func.m_ml = ml;
25446 op->func.m_self = (PyObject *) op;
25447 Py_XINCREF(closure);
25448 op->func_closure = closure;
25449 Py_XINCREF(module);
25450 op->func.m_module = module;
25451 op->func_dict = NULL;
25452 op->func_name = NULL;
25453 Py_INCREF(qualname);
25454 op->func_qualname = qualname;
25455 op->func_doc = NULL;
25456 op->func_classobj = NULL;
25457 op->func_globals = globals;
25458 Py_INCREF(op->func_globals);
25460 op->func_code = code;
25461 op->defaults_pyobjects = 0;
25462 op->defaults_size = 0;
25463 op->defaults = NULL;
25464 op->defaults_tuple = NULL;
25465 op->defaults_kwdict = NULL;
25466 op->defaults_getter = NULL;
25467 op->func_annotations = NULL;
25468 return (PyObject *) op;
25471 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25473 Py_CLEAR(m->func_closure);
25474 Py_CLEAR(m->func.m_module);
25475 Py_CLEAR(m->func_dict);
25476 Py_CLEAR(m->func_name);
25477 Py_CLEAR(m->func_qualname);
25478 Py_CLEAR(m->func_doc);
25479 Py_CLEAR(m->func_globals);
25480 Py_CLEAR(m->func_code);
25481 Py_CLEAR(m->func_classobj);
25482 Py_CLEAR(m->defaults_tuple);
25483 Py_CLEAR(m->defaults_kwdict);
25484 Py_CLEAR(m->func_annotations);
25486 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25488 for (i = 0; i < m->defaults_pyobjects; i++)
25489 Py_XDECREF(pydefaults[i]);
25490 PyObject_Free(m->defaults);
25491 m->defaults = NULL;
25495 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25497 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25498 PyObject_ClearWeakRefs((PyObject *) m);
25499 __Pyx_CyFunction_clear(m);
25500 PyObject_GC_Del(m);
25502 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25504 PyObject_GC_UnTrack(m);
25505 __Pyx__CyFunction_dealloc(m);
25507 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25509 Py_VISIT(m->func_closure);
25510 Py_VISIT(m->func.m_module);
25511 Py_VISIT(m->func_dict);
25512 Py_VISIT(m->func_name);
25513 Py_VISIT(m->func_qualname);
25514 Py_VISIT(m->func_doc);
25515 Py_VISIT(m->func_globals);
25516 Py_VISIT(m->func_code);
25517 Py_VISIT(m->func_classobj);
25518 Py_VISIT(m->defaults_tuple);
25519 Py_VISIT(m->defaults_kwdict);
25521 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25523 for (i = 0; i < m->defaults_pyobjects; i++)
25524 Py_VISIT(pydefaults[i]);
25528 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25530 #if PY_MAJOR_VERSION < 3
25531 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25532 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25536 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25538 type = (PyObject *)(Py_TYPE(obj));
25539 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25541 if (obj == Py_None)
25544 return __Pyx_PyMethod_New(func, obj, type);
25547 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25549 #if PY_MAJOR_VERSION >= 3
25550 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25551 op->func_qualname, (
void *)op);
25553 return PyString_FromFormat(
"<cyfunction %s at %p>",
25554 PyString_AsString(op->func_qualname), (
void *)op);
25557 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25558 PyCFunctionObject* f = (PyCFunctionObject*)func;
25559 PyCFunction meth = f->m_ml->ml_meth;
25561 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25563 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25564 return (*meth)(
self, arg);
25566 case METH_VARARGS | METH_KEYWORDS:
25567 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
25569 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25570 size = PyTuple_GET_SIZE(arg);
25571 if (likely(size == 0))
25572 return (*meth)(
self, NULL);
25573 PyErr_Format(PyExc_TypeError,
25574 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25575 f->m_ml->ml_name, size);
25580 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25581 size = PyTuple_GET_SIZE(arg);
25582 if (likely(size == 1)) {
25583 PyObject *result, *arg0;
25584 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25585 arg0 = PyTuple_GET_ITEM(arg, 0);
25587 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25589 result = (*meth)(
self, arg0);
25590 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25595 PyErr_Format(PyExc_TypeError,
25596 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25597 f->m_ml->ml_name, size);
25602 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25603 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25604 "longer supported!");
25607 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25611 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25612 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25614 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25616 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25617 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25619 PyObject *new_args;
25621 argc = PyTuple_GET_SIZE(args);
25622 new_args = PyTuple_GetSlice(args, 1, argc);
25623 if (unlikely(!new_args))
25625 self = PyTuple_GetItem(args, 0);
25626 if (unlikely(!
self)) {
25627 Py_DECREF(new_args);
25628 #if PY_MAJOR_VERSION > 2
25629 PyErr_Format(PyExc_TypeError,
25630 "unbound method %.200S() needs an argument",
25631 cyfunc->func_qualname);
25633 PyErr_SetString(PyExc_TypeError,
25634 "unbound method needs an argument");
25638 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25639 Py_DECREF(new_args);
25641 result = __Pyx_CyFunction_Call(func, args, kw);
25645 static PyTypeObject __pyx_CyFunctionType_type = {
25646 PyVarObject_HEAD_INIT(0, 0)
25647 "cython_function_or_method",
25648 sizeof(__pyx_CyFunctionObject),
25650 (destructor) __Pyx_CyFunction_dealloc,
25654 #if PY_MAJOR_VERSION < 3
25659 (reprfunc) __Pyx_CyFunction_repr,
25664 __Pyx_CyFunction_CallAsMethod,
25669 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25671 (traverseproc) __Pyx_CyFunction_traverse,
25672 (inquiry) __Pyx_CyFunction_clear,
25674 #
if PY_VERSION_HEX < 0x030500A0
25675 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25677 offsetof(PyCFunctionObject, m_weakreflist),
25681 __pyx_CyFunction_methods,
25682 __pyx_CyFunction_members,
25683 __pyx_CyFunction_getsets,
25686 __Pyx_CyFunction_descr_get,
25688 offsetof(__pyx_CyFunctionObject, func_dict),
25701 #if PY_VERSION_HEX >= 0x030400a1
25704 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25707 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25710 #if PY_VERSION_HEX >= 0x030C0000
25713 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
25717 static int __pyx_CyFunction_init(
void) {
25718 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25719 if (unlikely(__pyx_CyFunctionType == NULL)) {
25724 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25725 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25726 m->defaults = PyObject_Malloc(size);
25727 if (unlikely(!m->defaults))
25728 return PyErr_NoMemory();
25729 memset(m->defaults, 0, size);
25730 m->defaults_pyobjects = pyobjects;
25731 m->defaults_size = size;
25732 return m->defaults;
25734 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25735 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25736 m->defaults_tuple = tuple;
25739 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25740 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25741 m->defaults_kwdict = dict;
25744 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25745 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25746 m->func_annotations = dict;
25751 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
25752 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25753 PyObject *op = __Pyx_CyFunction_Init(
25754 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25755 ml, flags, qualname, closure, module, globals, code
25758 PyObject_GC_Track(op);
25764 #ifndef CYTHON_CLINE_IN_TRACEBACK
25765 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
25766 PyObject *use_cline;
25767 PyObject *ptype, *pvalue, *ptraceback;
25768 #if CYTHON_COMPILING_IN_CPYTHON
25769 PyObject **cython_runtime_dict;
25771 if (unlikely(!__pyx_cython_runtime)) {
25774 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25775 #if CYTHON_COMPILING_IN_CPYTHON
25776 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25777 if (likely(cython_runtime_dict)) {
25778 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25779 use_cline, *cython_runtime_dict,
25780 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25784 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25785 if (use_cline_obj) {
25786 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25787 Py_DECREF(use_cline_obj);
25795 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25797 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25800 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25806 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25807 int start = 0, mid = 0, end = count - 1;
25808 if (end >= 0 && code_line > entries[end].code_line) {
25811 while (start < end) {
25812 mid = start + (end - start) / 2;
25813 if (code_line < entries[mid].code_line) {
25815 }
else if (code_line > entries[mid].code_line) {
25821 if (code_line <= entries[mid].code_line) {
25827 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25828 PyCodeObject* code_object;
25830 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25833 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25834 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25837 code_object = __pyx_code_cache.entries[pos].code_object;
25838 Py_INCREF(code_object);
25839 return code_object;
25841 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25843 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25844 if (unlikely(!code_line)) {
25847 if (unlikely(!entries)) {
25848 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25849 if (likely(entries)) {
25850 __pyx_code_cache.entries = entries;
25851 __pyx_code_cache.max_count = 64;
25852 __pyx_code_cache.count = 1;
25853 entries[0].code_line = code_line;
25854 entries[0].code_object = code_object;
25855 Py_INCREF(code_object);
25859 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25860 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25861 PyCodeObject* tmp = entries[pos].code_object;
25862 entries[pos].code_object = code_object;
25866 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25867 int new_max = __pyx_code_cache.max_count + 64;
25868 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25869 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
25870 if (unlikely(!entries)) {
25873 __pyx_code_cache.entries = entries;
25874 __pyx_code_cache.max_count = new_max;
25876 for (i=__pyx_code_cache.count; i>pos; i--) {
25877 entries[i] = entries[i-1];
25879 entries[pos].code_line = code_line;
25880 entries[pos].code_object = code_object;
25881 __pyx_code_cache.count++;
25882 Py_INCREF(code_object);
25886 #include "compile.h"
25887 #include "frameobject.h"
25888 #include "traceback.h"
25889 #if PY_VERSION_HEX >= 0x030b00a6
25890 #ifndef Py_BUILD_CORE
25891 #define Py_BUILD_CORE 1
25893 #include "internal/pycore_frame.h"
25895 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25896 const char *funcname,
int c_line,
25897 int py_line,
const char *filename) {
25898 PyCodeObject *py_code = NULL;
25899 PyObject *py_funcname = NULL;
25900 #if PY_MAJOR_VERSION < 3
25901 PyObject *py_srcfile = NULL;
25902 py_srcfile = PyString_FromString(filename);
25903 if (!py_srcfile)
goto bad;
25906 #if PY_MAJOR_VERSION < 3
25907 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25908 if (!py_funcname)
goto bad;
25910 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25911 if (!py_funcname)
goto bad;
25912 funcname = PyUnicode_AsUTF8(py_funcname);
25913 if (!funcname)
goto bad;
25917 #if PY_MAJOR_VERSION < 3
25918 py_funcname = PyString_FromString(funcname);
25919 if (!py_funcname)
goto bad;
25922 #if PY_MAJOR_VERSION < 3
25923 py_code = __Pyx_PyCode_New(
25940 Py_DECREF(py_srcfile);
25942 py_code = PyCode_NewEmpty(filename, funcname, py_line);
25944 Py_XDECREF(py_funcname);
25947 Py_XDECREF(py_funcname);
25948 #if PY_MAJOR_VERSION < 3
25949 Py_XDECREF(py_srcfile);
25953 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
25954 int py_line,
const char *filename) {
25955 PyCodeObject *py_code = 0;
25956 PyFrameObject *py_frame = 0;
25957 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25958 PyObject *ptype, *pvalue, *ptraceback;
25960 c_line = __Pyx_CLineForTraceback(tstate, c_line);
25962 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25964 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25965 py_code = __Pyx_CreateCodeObjectForTraceback(
25966 funcname, c_line, py_line, filename);
25971 Py_XDECREF(pvalue);
25972 Py_XDECREF(ptraceback);
25975 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25976 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25978 py_frame = PyFrame_New(
25984 if (!py_frame)
goto bad;
25985 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25986 PyTraceBack_Here(py_frame);
25988 Py_XDECREF(py_code);
25989 Py_XDECREF(py_frame);
25992 #if PY_MAJOR_VERSION < 3
25993 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
25994 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
25995 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
25996 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
25997 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26000 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26001 PyObject *obj = view->obj;
26003 if (PyObject_CheckBuffer(obj)) {
26004 PyBuffer_Release(view);
26016 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26018 int i, index, step, start;
26019 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26020 if (order ==
'F') {
26027 for (i = 0; i < ndim; i++) {
26028 index = start + step * i;
26029 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26031 itemsize *= mvs.shape[index];
26038 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26039 void **out_start,
void **out_end,
26040 int ndim,
size_t itemsize)
26044 start = end = slice->data;
26045 for (i = 0; i < ndim; i++) {
26046 Py_ssize_t stride = slice->strides[i];
26047 Py_ssize_t extent = slice->shape[i];
26049 *out_start = *out_end = start;
26053 end += stride * (extent - 1);
26055 start += stride * (extent - 1);
26058 *out_start = start;
26059 *out_end = end + itemsize;
26062 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26063 __Pyx_memviewslice *slice2,
26064 int ndim,
size_t itemsize)
26066 void *start1, *end1, *start2, *end2;
26067 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26068 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26069 return (start1 < end2) && (start2 < end1);
26073 static CYTHON_INLINE PyObject *
26074 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26077 #if PY_VERSION_HEX >= 0x02070000
26078 cobj = PyCapsule_New(p, sig, NULL);
26080 cobj = PyCObject_FromVoidPtr(p, NULL);
26086 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26092 S.u32 = 0x01020304;
26093 return S.u8[0] == 4;
26097 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26098 __Pyx_BufFmt_StackElem* stack,
26099 __Pyx_TypeInfo* type) {
26100 stack[0].field = &ctx->root;
26101 stack[0].parent_offset = 0;
26102 ctx->root.type = type;
26103 ctx->root.name =
"buffer dtype";
26104 ctx->root.offset = 0;
26106 ctx->head->field = &ctx->root;
26107 ctx->fmt_offset = 0;
26108 ctx->head->parent_offset = 0;
26109 ctx->new_packmode =
'@';
26110 ctx->enc_packmode =
'@';
26111 ctx->new_count = 1;
26112 ctx->enc_count = 0;
26114 ctx->is_complex = 0;
26115 ctx->is_valid_array = 0;
26116 ctx->struct_alignment = 0;
26117 while (type->typegroup ==
'S') {
26119 ctx->head->field = type->fields;
26120 ctx->head->parent_offset = 0;
26121 type = type->fields->type;
26124 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26126 const char* t = *ts;
26127 if (*t < '0' || *t >
'9') {
26130 count = *t++ -
'0';
26131 while (*t >=
'0' && *t <=
'9') {
26133 count += *t++ -
'0';
26139 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26140 int number = __Pyx_BufFmt_ParseNumber(ts);
26142 PyErr_Format(PyExc_ValueError,\
26143 "Does not understand character buffer dtype format string ('%c')", **ts);
26146 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26147 PyErr_Format(PyExc_ValueError,
26148 "Unexpected format string character: '%c'", ch);
26150 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26152 case '?':
return "'bool'";
26153 case 'c':
return "'char'";
26154 case 'b':
return "'signed char'";
26155 case 'B':
return "'unsigned char'";
26156 case 'h':
return "'short'";
26157 case 'H':
return "'unsigned short'";
26158 case 'i':
return "'int'";
26159 case 'I':
return "'unsigned int'";
26160 case 'l':
return "'long'";
26161 case 'L':
return "'unsigned long'";
26162 case 'q':
return "'long long'";
26163 case 'Q':
return "'unsigned long long'";
26164 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26165 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26166 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26167 case 'T':
return "a struct";
26168 case 'O':
return "Python object";
26169 case 'P':
return "a pointer";
26170 case 's':
case 'p':
return "a string";
26171 case 0:
return "end";
26172 default:
return "unparseable format string";
26175 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26177 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26178 case 'h':
case 'H':
return 2;
26179 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26180 case 'q':
case 'Q':
return 8;
26181 case 'f':
return (is_complex ? 8 : 4);
26182 case 'd':
return (is_complex ? 16 : 8);
26184 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26187 case 'O':
case 'P':
return sizeof(
void*);
26189 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26193 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26195 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26196 case 'h':
case 'H':
return sizeof(short);
26197 case 'i':
case 'I':
return sizeof(int);
26198 case 'l':
case 'L':
return sizeof(long);
26199 #ifdef HAVE_LONG_LONG
26200 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26202 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26203 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26204 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26205 case 'O':
case 'P':
return sizeof(
void*);
26207 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26212 typedef struct {
char c;
short x; } __Pyx_st_short;
26213 typedef struct {
char c;
int x; } __Pyx_st_int;
26214 typedef struct {
char c;
long x; } __Pyx_st_long;
26215 typedef struct {
char c;
float x; } __Pyx_st_float;
26216 typedef struct {
char c;
double x; } __Pyx_st_double;
26217 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26218 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26219 #ifdef HAVE_LONG_LONG
26220 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26222 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26224 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26225 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26226 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26227 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26228 #ifdef HAVE_LONG_LONG
26229 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26231 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26232 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26233 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26234 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26236 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26244 typedef struct {
short x;
char c; } __Pyx_pad_short;
26245 typedef struct {
int x;
char c; } __Pyx_pad_int;
26246 typedef struct {
long x;
char c; } __Pyx_pad_long;
26247 typedef struct {
float x;
char c; } __Pyx_pad_float;
26248 typedef struct {
double x;
char c; } __Pyx_pad_double;
26249 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26250 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26251 #ifdef HAVE_LONG_LONG
26252 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26254 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26256 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26257 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26258 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26259 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26260 #ifdef HAVE_LONG_LONG
26261 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26263 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26264 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26265 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26266 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26268 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26272 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26276 case 'b':
case 'h':
case 'i':
26277 case 'l':
case 'q':
case 's':
case 'p':
26279 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26281 case 'f':
case 'd':
case 'g':
26282 return (is_complex ?
'C' :
'R');
26288 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26293 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26294 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26295 const char* expected;
26297 if (ctx->head == NULL) {
26301 expected = ctx->head->field->type->name;
26304 PyErr_Format(PyExc_ValueError,
26305 "Buffer dtype mismatch, expected %s%s%s but got %s",
26306 quote, expected, quote,
26307 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26309 __Pyx_StructField* field = ctx->head->field;
26310 __Pyx_StructField* parent = (ctx->head - 1)->field;
26311 PyErr_Format(PyExc_ValueError,
26312 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26313 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26314 parent->type->name, field->name);
26317 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26319 size_t size, offset, arraysize = 1;
26320 if (ctx->enc_type == 0)
return 0;
26321 if (ctx->head->field->type->arraysize[0]) {
26323 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
26324 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26326 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26327 PyErr_Format(PyExc_ValueError,
26328 "Expected a dimension of size %zu, got %zu",
26329 ctx->head->field->type->arraysize[0], ctx->enc_count);
26333 if (!ctx->is_valid_array) {
26334 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
26335 ctx->head->field->type->ndim, ndim);
26338 for (i = 0; i < ctx->head->field->type->ndim; i++) {
26339 arraysize *= ctx->head->field->type->arraysize[i];
26341 ctx->is_valid_array = 0;
26342 ctx->enc_count = 1;
26344 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26346 __Pyx_StructField* field = ctx->head->field;
26347 __Pyx_TypeInfo* type = field->type;
26348 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
26349 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26351 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26353 if (ctx->enc_packmode ==
'@') {
26354 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26355 size_t align_mod_offset;
26356 if (align_at == 0)
return -1;
26357 align_mod_offset = ctx->fmt_offset % align_at;
26358 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26359 if (ctx->struct_alignment == 0)
26360 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26363 if (type->size != size || type->typegroup != group) {
26364 if (type->typegroup ==
'C' && type->fields != NULL) {
26365 size_t parent_offset = ctx->head->parent_offset + field->offset;
26367 ctx->head->field = type->fields;
26368 ctx->head->parent_offset = parent_offset;
26371 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
26373 __Pyx_BufFmt_RaiseExpected(ctx);
26377 offset = ctx->head->parent_offset + field->offset;
26378 if (ctx->fmt_offset != offset) {
26379 PyErr_Format(PyExc_ValueError,
26380 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
26381 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26384 ctx->fmt_offset += size;
26386 ctx->fmt_offset += (arraysize - 1) * size;
26389 if (field == &ctx->root) {
26391 if (ctx->enc_count != 0) {
26392 __Pyx_BufFmt_RaiseExpected(ctx);
26397 ctx->head->field = ++field;
26398 if (field->type == NULL) {
26400 field = ctx->head->field;
26402 }
else if (field->type->typegroup ==
'S') {
26403 size_t parent_offset = ctx->head->parent_offset + field->offset;
26404 if (field->type->fields->type == NULL)
continue;
26405 field = field->type->fields;
26407 ctx->head->field = field;
26408 ctx->head->parent_offset = parent_offset;
26414 }
while (ctx->enc_count);
26416 ctx->is_complex = 0;
26420 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
26422 const char *ts = *tsp;
26423 int i = 0, number, ndim;
26425 if (ctx->new_count != 1) {
26426 PyErr_SetString(PyExc_ValueError,
26427 "Cannot handle repeated arrays in format string");
26430 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26431 ndim = ctx->head->field->type->ndim;
26432 while (*ts && *ts !=
')') {
26434 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
26437 number = __Pyx_BufFmt_ExpectNumber(&ts);
26438 if (number == -1)
return NULL;
26439 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
26440 return PyErr_Format(PyExc_ValueError,
26441 "Expected a dimension of size %zu, got %d",
26442 ctx->head->field->type->arraysize[i], number);
26443 if (*ts !=
',' && *ts !=
')')
26444 return PyErr_Format(PyExc_ValueError,
26445 "Expected a comma in format string, got '%c'", *ts);
26446 if (*ts ==
',') ts++;
26450 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
26451 ctx->head->field->type->ndim, i);
26453 PyErr_SetString(PyExc_ValueError,
26454 "Unexpected end of format string, expected ')'");
26457 ctx->is_valid_array = 1;
26458 ctx->new_count = 1;
26462 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
26467 if (ctx->enc_type != 0 && ctx->head == NULL) {
26468 __Pyx_BufFmt_RaiseExpected(ctx);
26471 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26472 if (ctx->head != NULL) {
26473 __Pyx_BufFmt_RaiseExpected(ctx);
26483 if (!__Pyx_Is_Little_Endian()) {
26484 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
26487 ctx->new_packmode =
'=';
26492 if (__Pyx_Is_Little_Endian()) {
26493 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
26496 ctx->new_packmode =
'=';
26502 ctx->new_packmode = *ts++;
26506 const char* ts_after_sub;
26507 size_t i, struct_count = ctx->new_count;
26508 size_t struct_alignment = ctx->struct_alignment;
26509 ctx->new_count = 1;
26512 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
26515 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26517 ctx->enc_count = 0;
26518 ctx->struct_alignment = 0;
26521 for (i = 0; i != struct_count; ++i) {
26522 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26523 if (!ts_after_sub)
return NULL;
26526 if (struct_alignment) ctx->struct_alignment = struct_alignment;
26531 size_t alignment = ctx->struct_alignment;
26533 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26535 if (alignment && ctx->fmt_offset % alignment) {
26536 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26541 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26542 ctx->fmt_offset += ctx->new_count;
26543 ctx->new_count = 1;
26544 ctx->enc_count = 0;
26546 ctx->enc_packmode = ctx->new_packmode;
26552 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
26553 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
26556 CYTHON_FALLTHROUGH;
26557 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
26558 case 'l':
case 'L':
case 'q':
case 'Q':
26559 case 'f':
case 'd':
case 'g':
26560 case 'O':
case 'p':
26561 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
26562 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
26563 ctx->enc_count += ctx->new_count;
26564 ctx->new_count = 1;
26569 CYTHON_FALLTHROUGH;
26571 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
26572 ctx->enc_count = ctx->new_count;
26573 ctx->enc_packmode = ctx->new_packmode;
26574 ctx->enc_type = *ts;
26575 ctx->is_complex = got_Z;
26577 ctx->new_count = 1;
26582 while(*ts !=
':') ++ts;
26586 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
26590 int number = __Pyx_BufFmt_ExpectNumber(&ts);
26591 if (number == -1)
return NULL;
26592 ctx->new_count = (size_t)number;
26600 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26607 if (a->size != b->size || a->typegroup != b->typegroup ||
26608 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26609 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
26610 return a->size == b->size;
26616 for (i = 0; i < a->ndim; i++)
26617 if (a->arraysize[i] != b->arraysize[i])
26620 if (a->typegroup ==
'S') {
26621 if (a->flags != b->flags)
26623 if (a->fields || b->fields) {
26624 if (!(a->fields && b->fields))
26626 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26627 __Pyx_StructField *field_a = a->fields + i;
26628 __Pyx_StructField *field_b = b->fields + i;
26629 if (field_a->offset != field_b->offset ||
26630 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26633 return !a->fields[i].type && !b->fields[i].type;
26641 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
26643 if (buf->shape[dim] <= 1)
26645 if (buf->strides) {
26646 if (spec & __Pyx_MEMVIEW_CONTIG) {
26647 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26648 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
26649 PyErr_Format(PyExc_ValueError,
26650 "Buffer is not indirectly contiguous "
26651 "in dimension %d.", dim);
26654 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
26655 PyErr_SetString(PyExc_ValueError,
26656 "Buffer and memoryview are not contiguous "
26657 "in the same dimension.");
26661 if (spec & __Pyx_MEMVIEW_FOLLOW) {
26662 Py_ssize_t stride = buf->strides[dim];
26665 if (unlikely(stride < buf->itemsize)) {
26666 PyErr_SetString(PyExc_ValueError,
26667 "Buffer and memoryview are not contiguous "
26668 "in the same dimension.");
26673 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
26674 PyErr_Format(PyExc_ValueError,
26675 "C-contiguous buffer is not contiguous in "
26676 "dimension %d", dim);
26678 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
26679 PyErr_Format(PyExc_ValueError,
26680 "C-contiguous buffer is not indirect in "
26681 "dimension %d", dim);
26683 }
else if (unlikely(buf->suboffsets)) {
26684 PyErr_SetString(PyExc_ValueError,
26685 "Buffer exposes suboffsets but no strides");
26694 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
26696 if (spec & __Pyx_MEMVIEW_DIRECT) {
26697 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
26698 PyErr_Format(PyExc_ValueError,
26699 "Buffer not compatible with direct access "
26700 "in dimension %d.", dim);
26704 if (spec & __Pyx_MEMVIEW_PTR) {
26705 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
26706 PyErr_Format(PyExc_ValueError,
26707 "Buffer is not indirectly accessible "
26708 "in dimension %d.", dim);
26717 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
26720 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26721 Py_ssize_t stride = 1;
26722 for (i = 0; i < ndim; i++) {
26723 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26724 PyErr_SetString(PyExc_ValueError,
26725 "Buffer not fortran contiguous.");
26728 stride = stride * buf->shape[i];
26730 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26731 Py_ssize_t stride = 1;
26732 for (i = ndim - 1; i >- 1; i--) {
26733 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
26734 PyErr_SetString(PyExc_ValueError,
26735 "Buffer not C contiguous.");
26738 stride = stride * buf->shape[i];
26745 static int __Pyx_ValidateAndInit_memviewslice(
26750 __Pyx_TypeInfo *dtype,
26751 __Pyx_BufFmt_StackElem stack[],
26752 __Pyx_memviewslice *memviewslice,
26753 PyObject *original_obj)
26755 struct __pyx_memoryview_obj *memview, *new_memview;
26756 __Pyx_RefNannyDeclarations
26758 int i, spec = 0, retval = -1;
26759 __Pyx_BufFmt_Context ctx;
26760 int from_memoryview = __pyx_memoryview_check(original_obj);
26761 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
26762 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
26763 original_obj)->typeinfo)) {
26764 memview = (
struct __pyx_memoryview_obj *) original_obj;
26765 new_memview = NULL;
26767 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26768 original_obj, buf_flags, 0, dtype);
26769 new_memview = memview;
26770 if (unlikely(!memview))
26773 buf = &memview->view;
26774 if (unlikely(buf->ndim != ndim)) {
26775 PyErr_Format(PyExc_ValueError,
26776 "Buffer has wrong number of dimensions (expected %d, got %d)",
26781 __Pyx_BufFmt_Init(&ctx, stack, dtype);
26782 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
26784 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
26785 PyErr_Format(PyExc_ValueError,
26786 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
26787 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
26789 (buf->itemsize > 1) ?
"s" :
"",
26792 (dtype->size > 1) ?
"s" :
"");
26795 if (buf->len > 0) {
26796 for (i = 0; i < ndim; i++) {
26797 spec = axes_specs[i];
26798 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
26800 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26803 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26806 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26807 new_memview != NULL) == -1)) {
26813 Py_XDECREF(new_memview);
26816 __Pyx_RefNannyFinishContext();
26821 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
26822 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26823 __Pyx_BufFmt_StackElem stack[1];
26824 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26826 if (obj == Py_None) {
26827 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26830 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26831 PyBUF_RECORDS_RO | writable_flag, 1,
26832 &__Pyx_TypeInfo_float, stack,
26834 if (unlikely(retcode == -1))
26838 result.memview = NULL;
26839 result.data = NULL;
26844 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
26845 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26846 __Pyx_BufFmt_StackElem stack[1];
26847 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26849 if (obj == Py_None) {
26850 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26853 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26854 PyBUF_RECORDS_RO | writable_flag, 1,
26855 &__Pyx_TypeInfo_double, stack,
26857 if (unlikely(retcode == -1))
26861 result.memview = NULL;
26862 result.data = NULL;
26867 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
26868 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26869 __Pyx_BufFmt_StackElem stack[1];
26870 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26872 if (obj == Py_None) {
26873 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
26876 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26877 PyBUF_RECORDS_RO | writable_flag, 1,
26878 &__Pyx_TypeInfo_long__double, stack,
26880 if (unlikely(retcode == -1))
26884 result.memview = NULL;
26885 result.data = NULL;
26890 static __Pyx_memviewslice
26891 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
26892 const char *mode,
int ndim,
26893 size_t sizeof_dtype,
int contig_flag,
26894 int dtype_is_object)
26896 __Pyx_RefNannyDeclarations
26898 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26899 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26900 Py_buffer *buf = &from_memview->view;
26901 PyObject *shape_tuple = NULL;
26902 PyObject *temp_int = NULL;
26903 struct __pyx_array_obj *array_obj = NULL;
26904 struct __pyx_memoryview_obj *memview_obj = NULL;
26905 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
26906 for (i = 0; i < ndim; i++) {
26907 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26908 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
26909 "indirect dimensions (axis %d)", i);
26913 shape_tuple = PyTuple_New(ndim);
26914 if (unlikely(!shape_tuple)) {
26917 __Pyx_GOTREF(shape_tuple);
26918 for(i = 0; i < ndim; i++) {
26919 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26920 if(unlikely(!temp_int)) {
26923 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26927 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
26928 if (unlikely(!array_obj)) {
26931 __Pyx_GOTREF(array_obj);
26932 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26933 (PyObject *) array_obj, contig_flag,
26935 from_mvs->memview->typeinfo);
26936 if (unlikely(!memview_obj))
26938 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26940 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26941 dtype_is_object) < 0))
26945 __Pyx_XDECREF(new_mvs.memview);
26946 new_mvs.memview = NULL;
26947 new_mvs.data = NULL;
26949 __Pyx_XDECREF(shape_tuple);
26950 __Pyx_XDECREF(temp_int);
26951 __Pyx_XDECREF(array_obj);
26952 __Pyx_RefNannyFinishContext();
26957 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26958 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26959 #pragma GCC diagnostic push
26960 #pragma GCC diagnostic ignored "-Wconversion"
26962 const int neg_one = (int) -1, const_zero = (
int) 0;
26963 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26964 #pragma GCC diagnostic pop
26966 const int is_unsigned = neg_one > const_zero;
26968 if (
sizeof(
int) <
sizeof(long)) {
26969 return PyInt_FromLong((
long) value);
26970 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26971 return PyLong_FromUnsignedLong((
unsigned long) value);
26972 #ifdef HAVE_LONG_LONG
26973 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26974 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26978 if (
sizeof(
int) <=
sizeof(
long)) {
26979 return PyInt_FromLong((
long) value);
26980 #ifdef HAVE_LONG_LONG
26981 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26982 return PyLong_FromLongLong((PY_LONG_LONG) value);
26987 int one = 1;
int little = (int)*(
unsigned char *)&one;
26988 unsigned char *bytes = (
unsigned char *)&value;
26989 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26990 little, !is_unsigned);
26995 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26996 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26997 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26998 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26999 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27001 func_type value = func_value;\
27002 if (sizeof(target_type) < sizeof(func_type)) {\
27003 if (unlikely(value != (func_type) (target_type) value)) {\
27004 func_type zero = 0;\
27005 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27006 return (target_type) -1;\
27007 if (is_unsigned && unlikely(value < zero))\
27008 goto raise_neg_overflow;\
27010 goto raise_overflow;\
27013 return (target_type) value;\
27017 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27018 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27019 #pragma GCC diagnostic push
27020 #pragma GCC diagnostic ignored "-Wconversion"
27022 const int neg_one = (int) -1, const_zero = (
int) 0;
27023 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27024 #pragma GCC diagnostic pop
27026 const int is_unsigned = neg_one > const_zero;
27027 #if PY_MAJOR_VERSION < 3
27028 if (likely(PyInt_Check(x))) {
27029 if (
sizeof(
int) <
sizeof(long)) {
27030 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27032 long val = PyInt_AS_LONG(x);
27033 if (is_unsigned && unlikely(val < 0)) {
27034 goto raise_neg_overflow;
27040 if (likely(PyLong_Check(x))) {
27042 #if CYTHON_USE_PYLONG_INTERNALS
27043 const digit* digits = ((PyLongObject*)x)->ob_digit;
27044 switch (Py_SIZE(x)) {
27045 case 0:
return (
int) 0;
27046 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27048 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27049 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27050 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27051 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27052 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27057 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27058 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27059 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27060 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27061 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27066 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27067 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27068 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27069 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27070 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27076 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27077 if (unlikely(Py_SIZE(x) < 0)) {
27078 goto raise_neg_overflow;
27082 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27083 if (unlikely(result < 0))
27085 if (unlikely(result == 1))
27086 goto raise_neg_overflow;
27089 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27090 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27091 #ifdef HAVE_LONG_LONG
27092 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27093 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27097 #if CYTHON_USE_PYLONG_INTERNALS
27098 const digit* digits = ((PyLongObject*)x)->ob_digit;
27099 switch (Py_SIZE(x)) {
27100 case 0:
return (
int) 0;
27101 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27102 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27104 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27105 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27106 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27107 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27108 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27113 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27114 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27115 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27116 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27117 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27122 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27123 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27124 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27125 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27126 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27131 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27132 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27133 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27134 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27135 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27140 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27141 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27142 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27143 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27144 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27149 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27150 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27151 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27152 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27153 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27159 if (
sizeof(
int) <=
sizeof(long)) {
27160 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27161 #ifdef HAVE_LONG_LONG
27162 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27163 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27168 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27169 PyErr_SetString(PyExc_RuntimeError,
27170 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27173 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27174 #if PY_MAJOR_VERSION < 3
27175 if (likely(v) && !PyLong_Check(v)) {
27177 v = PyNumber_Long(tmp);
27182 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27183 unsigned char *bytes = (
unsigned char *)&val;
27184 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27185 bytes,
sizeof(val),
27186 is_little, !is_unsigned);
27196 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27197 if (!tmp)
return (
int) -1;
27198 val = __Pyx_PyInt_As_int(tmp);
27203 PyErr_SetString(PyExc_OverflowError,
27204 "value too large to convert to int");
27206 raise_neg_overflow:
27207 PyErr_SetString(PyExc_OverflowError,
27208 "can't convert negative value to int");
27213 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
27214 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27215 #pragma GCC diagnostic push
27216 #pragma GCC diagnostic ignored "-Wconversion"
27218 const long neg_one = (long) -1, const_zero = (
long) 0;
27219 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27220 #pragma GCC diagnostic pop
27222 const int is_unsigned = neg_one > const_zero;
27223 #if PY_MAJOR_VERSION < 3
27224 if (likely(PyInt_Check(x))) {
27225 if (
sizeof(
long) <
sizeof(long)) {
27226 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
27228 long val = PyInt_AS_LONG(x);
27229 if (is_unsigned && unlikely(val < 0)) {
27230 goto raise_neg_overflow;
27236 if (likely(PyLong_Check(x))) {
27238 #if CYTHON_USE_PYLONG_INTERNALS
27239 const digit* digits = ((PyLongObject*)x)->ob_digit;
27240 switch (Py_SIZE(x)) {
27241 case 0:
return (
long) 0;
27242 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
27244 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27245 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27246 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27247 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
27248 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27253 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27254 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27255 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27256 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
27257 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27262 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27263 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27264 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27265 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
27266 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
27272 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27273 if (unlikely(Py_SIZE(x) < 0)) {
27274 goto raise_neg_overflow;
27278 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27279 if (unlikely(result < 0))
27281 if (unlikely(result == 1))
27282 goto raise_neg_overflow;
27285 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27286 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
27287 #ifdef HAVE_LONG_LONG
27288 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27289 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27293 #if CYTHON_USE_PYLONG_INTERNALS
27294 const digit* digits = ((PyLongObject*)x)->ob_digit;
27295 switch (Py_SIZE(x)) {
27296 case 0:
return (
long) 0;
27297 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27298 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27300 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27301 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27302 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27303 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27304 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27309 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27310 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27311 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27312 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27313 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27318 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27319 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27320 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27321 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27322 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27327 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27328 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27329 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27330 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27331 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27336 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27337 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27338 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27339 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27340 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27345 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27346 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27347 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27348 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27349 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27355 if (
sizeof(
long) <=
sizeof(long)) {
27356 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27357 #ifdef HAVE_LONG_LONG
27358 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27359 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27364 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27365 PyErr_SetString(PyExc_RuntimeError,
27366 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27369 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27370 #if PY_MAJOR_VERSION < 3
27371 if (likely(v) && !PyLong_Check(v)) {
27373 v = PyNumber_Long(tmp);
27378 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27379 unsigned char *bytes = (
unsigned char *)&val;
27380 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27381 bytes,
sizeof(val),
27382 is_little, !is_unsigned);
27392 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27393 if (!tmp)
return (
long) -1;
27394 val = __Pyx_PyInt_As_long(tmp);
27399 PyErr_SetString(PyExc_OverflowError,
27400 "value too large to convert to long");
27402 raise_neg_overflow:
27403 PyErr_SetString(PyExc_OverflowError,
27404 "can't convert negative value to long");
27409 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27410 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27411 #pragma GCC diagnostic push
27412 #pragma GCC diagnostic ignored "-Wconversion"
27414 const long neg_one = (long) -1, const_zero = (
long) 0;
27415 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27416 #pragma GCC diagnostic pop
27418 const int is_unsigned = neg_one > const_zero;
27420 if (
sizeof(
long) <
sizeof(long)) {
27421 return PyInt_FromLong((
long) value);
27422 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27423 return PyLong_FromUnsignedLong((
unsigned long) value);
27424 #ifdef HAVE_LONG_LONG
27425 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27426 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27430 if (
sizeof(
long) <=
sizeof(
long)) {
27431 return PyInt_FromLong((
long) value);
27432 #ifdef HAVE_LONG_LONG
27433 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27434 return PyLong_FromLongLong((PY_LONG_LONG) value);
27439 int one = 1;
int little = (int)*(
unsigned char *)&one;
27440 unsigned char *bytes = (
unsigned char *)&value;
27441 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27442 little, !is_unsigned);
27447 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
27448 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27449 #pragma GCC diagnostic push
27450 #pragma GCC diagnostic ignored "-Wconversion"
27452 const char neg_one = (char) -1, const_zero = (
char) 0;
27453 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27454 #pragma GCC diagnostic pop
27456 const int is_unsigned = neg_one > const_zero;
27457 #if PY_MAJOR_VERSION < 3
27458 if (likely(PyInt_Check(x))) {
27459 if (
sizeof(
char) <
sizeof(long)) {
27460 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
27462 long val = PyInt_AS_LONG(x);
27463 if (is_unsigned && unlikely(val < 0)) {
27464 goto raise_neg_overflow;
27470 if (likely(PyLong_Check(x))) {
27472 #if CYTHON_USE_PYLONG_INTERNALS
27473 const digit* digits = ((PyLongObject*)x)->ob_digit;
27474 switch (Py_SIZE(x)) {
27475 case 0:
return (
char) 0;
27476 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
27478 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27479 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27480 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27481 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
27482 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27487 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27488 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27489 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27490 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
27491 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27496 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27497 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27498 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27499 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
27500 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
27506 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
27507 if (unlikely(Py_SIZE(x) < 0)) {
27508 goto raise_neg_overflow;
27512 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27513 if (unlikely(result < 0))
27515 if (unlikely(result == 1))
27516 goto raise_neg_overflow;
27519 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
27520 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
27521 #ifdef HAVE_LONG_LONG
27522 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
27523 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27527 #if CYTHON_USE_PYLONG_INTERNALS
27528 const digit* digits = ((PyLongObject*)x)->ob_digit;
27529 switch (Py_SIZE(x)) {
27530 case 0:
return (
char) 0;
27531 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
27532 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
27534 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
27535 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27536 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27537 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27538 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27543 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
27544 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27545 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27546 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27547 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27552 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
27553 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27554 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27555 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27556 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27561 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
27562 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27563 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27564 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27565 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27570 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
27571 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27572 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27573 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27574 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27579 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
27580 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27581 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27582 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
27583 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
27589 if (
sizeof(
char) <=
sizeof(long)) {
27590 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
27591 #ifdef HAVE_LONG_LONG
27592 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
27593 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
27598 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27599 PyErr_SetString(PyExc_RuntimeError,
27600 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27603 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27604 #if PY_MAJOR_VERSION < 3
27605 if (likely(v) && !PyLong_Check(v)) {
27607 v = PyNumber_Long(tmp);
27612 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27613 unsigned char *bytes = (
unsigned char *)&val;
27614 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27615 bytes,
sizeof(val),
27616 is_little, !is_unsigned);
27626 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27627 if (!tmp)
return (
char) -1;
27628 val = __Pyx_PyInt_As_char(tmp);
27633 PyErr_SetString(PyExc_OverflowError,
27634 "value too large to convert to char");
27636 raise_neg_overflow:
27637 PyErr_SetString(PyExc_OverflowError,
27638 "can't convert negative value to char");
27643 static int __Pyx_check_binary_version(
void) {
27645 int same=1, i, found_dot;
27646 const char* rt_from_call = Py_GetVersion();
27647 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27649 for (i = 0; i < 4; i++) {
27650 if (!ctversion[i]) {
27651 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
27654 if (rt_from_call[i] != ctversion[i]) {
27660 char rtversion[5] = {
'\0'};
27662 for (i=0; i<4; ++i) {
27663 if (rt_from_call[i] ==
'.') {
27664 if (found_dot)
break;
27666 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
27669 rtversion[i] = rt_from_call[i];
27671 PyOS_snprintf(message,
sizeof(message),
27672 "compiletime version %s of module '%.100s' "
27673 "does not match runtime version %s",
27674 ctversion, __Pyx_MODULE_NAME, rtversion);
27675 return PyErr_WarnEx(NULL, message, 1);
27681 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27683 #if PY_MAJOR_VERSION < 3
27684 if (t->is_unicode) {
27685 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27686 }
else if (t->intern) {
27687 *t->p = PyString_InternFromString(t->s);
27689 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27692 if (t->is_unicode | t->is_str) {
27694 *t->p = PyUnicode_InternFromString(t->s);
27695 }
else if (t->encoding) {
27696 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27698 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27701 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27706 if (PyObject_Hash(*t->p) == -1)
27713 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
27714 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27716 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
27718 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27720 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27721 #if !CYTHON_PEP393_ENABLED
27722 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27724 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27725 if (!defenc)
return NULL;
27726 defenc_c = PyBytes_AS_STRING(defenc);
27727 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27729 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27731 for (c = defenc_c; c < end; c++) {
27732 if ((
unsigned char) (*c) >= 128) {
27733 PyUnicode_AsASCIIString(o);
27739 *length = PyBytes_GET_SIZE(defenc);
27743 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27744 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
27745 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27746 if (likely(PyUnicode_IS_ASCII(o))) {
27747 *length = PyUnicode_GET_LENGTH(o);
27748 return PyUnicode_AsUTF8(o);
27750 PyUnicode_AsASCIIString(o);
27754 return PyUnicode_AsUTF8AndSize(o, length);
27759 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27760 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27762 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27763 __Pyx_sys_getdefaultencoding_not_ascii &&
27765 PyUnicode_Check(o)) {
27766 return __Pyx_PyUnicode_AsStringAndSize(o, length);
27769 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27770 if (PyByteArray_Check(o)) {
27771 *length = PyByteArray_GET_SIZE(o);
27772 return PyByteArray_AS_STRING(o);
27777 int r = PyBytes_AsStringAndSize(o, &result, length);
27778 if (unlikely(r < 0)) {
27785 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
27786 int is_true = x == Py_True;
27787 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
27788 else return PyObject_IsTrue(x);
27790 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27792 if (unlikely(!x))
return -1;
27793 retval = __Pyx_PyObject_IsTrue(x);
27797 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
27798 #if PY_MAJOR_VERSION >= 3
27799 if (PyLong_Check(result)) {
27800 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27801 "__int__ returned non-int (type %.200s). "
27802 "The ability to return an instance of a strict subclass of int "
27803 "is deprecated, and may be removed in a future version of Python.",
27804 Py_TYPE(result)->tp_name)) {
27811 PyErr_Format(PyExc_TypeError,
27812 "__%.4s__ returned non-%.4s (type %.200s)",
27813 type_name, type_name, Py_TYPE(result)->tp_name);
27817 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27818 #if CYTHON_USE_TYPE_SLOTS
27819 PyNumberMethods *m;
27821 const char *name = NULL;
27822 PyObject *res = NULL;
27823 #if PY_MAJOR_VERSION < 3
27824 if (likely(PyInt_Check(x) || PyLong_Check(x)))
27826 if (likely(PyLong_Check(x)))
27828 return __Pyx_NewRef(x);
27829 #if CYTHON_USE_TYPE_SLOTS
27830 m = Py_TYPE(x)->tp_as_number;
27831 #if PY_MAJOR_VERSION < 3
27832 if (m && m->nb_int) {
27834 res = m->nb_int(x);
27836 else if (m && m->nb_long) {
27838 res = m->nb_long(x);
27841 if (likely(m && m->nb_int)) {
27843 res = m->nb_int(x);
27847 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27848 res = PyNumber_Int(x);
27852 #if PY_MAJOR_VERSION < 3
27853 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27855 if (unlikely(!PyLong_CheckExact(res))) {
27857 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27860 else if (!PyErr_Occurred()) {
27861 PyErr_SetString(PyExc_TypeError,
27862 "an integer is required");
27866 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27869 #if PY_MAJOR_VERSION < 3
27870 if (likely(PyInt_CheckExact(b))) {
27871 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
27872 return PyInt_AS_LONG(b);
27874 return PyInt_AsSsize_t(b);
27877 if (likely(PyLong_CheckExact(b))) {
27878 #if CYTHON_USE_PYLONG_INTERNALS
27879 const digit* digits = ((PyLongObject*)b)->ob_digit;
27880 const Py_ssize_t size = Py_SIZE(b);
27881 if (likely(__Pyx_sst_abs(size) <= 1)) {
27882 ival = likely(size) ? digits[0] : 0;
27883 if (size == -1) ival = -ival;
27888 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27889 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27893 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27894 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27898 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27899 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27903 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27904 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27908 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27909 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27913 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27914 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27920 return PyLong_AsSsize_t(b);
27922 x = PyNumber_Index(b);
27924 ival = PyInt_AsSsize_t(x);
27928 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
27929 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
27930 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
27931 #if PY_MAJOR_VERSION < 3
27932 }
else if (likely(PyInt_CheckExact(o))) {
27933 return PyInt_AS_LONG(o);
27938 x = PyNumber_Index(o);
27940 ival = PyInt_AsLong(x);
27945 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
27946 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27948 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
27949 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.